1 | import { NativeEventEmitter } from 'react-native';
|
2 | import type { AsyncHookResult } from './types';
|
3 | /**
|
4 | * simple hook wrapper for async functions for 'on-mount / componentDidMount' that only need to fired once
|
5 | * @param asyncGetter async function that 'gets' something
|
6 | * @param initialResult -1 | false | 'unknown'
|
7 | */
|
8 | export declare function useOnMount<T>(asyncGetter: () => Promise<T>, initialResult: T): AsyncHookResult<T>;
|
9 | export declare const deviceInfoEmitter: NativeEventEmitter;
|
10 | /**
|
11 | * simple hook wrapper for handling events
|
12 | * @param eventName
|
13 | * @param initialValueAsyncGetter
|
14 | * @param defaultValue
|
15 | */
|
16 | export declare function useOnEvent<T>(eventName: string, initialValueAsyncGetter: () => Promise<T>, defaultValue: T): AsyncHookResult<T>;
|