1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | declare module 'react-native/Libraries/Utilities/codegenNativeCommands' {
|
11 | export interface Options<T extends string> {
|
12 | readonly supportedCommands: ReadonlyArray<T>;
|
13 | }
|
14 |
|
15 | function codegenNativeCommands<T extends object>(
|
16 | options: Options<keyof T extends string ? keyof T : never>,
|
17 | ): T;
|
18 |
|
19 | export default codegenNativeCommands;
|
20 | }
|
21 |
|
22 | declare module 'react-native/Libraries/Utilities/codegenNativeComponent' {
|
23 | import type {HostComponent} from 'react-native';
|
24 |
|
25 | export interface Options {
|
26 | readonly interfaceOnly?: boolean | undefined;
|
27 | readonly paperComponentName?: string | undefined;
|
28 | readonly paperComponentNameDeprecated?: string | undefined;
|
29 | readonly excludedPlatforms?: ReadonlyArray<'iOS' | 'android'> | undefined;
|
30 | }
|
31 |
|
32 | export type NativeComponentType<T> = HostComponent<T>;
|
33 |
|
34 | function codegenNativeComponent<Props extends object>(
|
35 | componentName: string,
|
36 | options?: Options,
|
37 | ): NativeComponentType<Props>;
|
38 |
|
39 | export default codegenNativeComponent;
|
40 | }
|
41 |
|
42 | declare module 'react-native/Libraries/Types/CodegenTypes' {
|
43 | import type {NativeSyntheticEvent} from 'react-native';
|
44 |
|
45 |
|
46 |
|
47 |
|
48 | export type BubblingEventHandler<
|
49 | T,
|
50 | PaperName extends string | never = never,
|
51 | > = (event: NativeSyntheticEvent<T>) => void | Promise<void>;
|
52 | export type DirectEventHandler<
|
53 | T,
|
54 | PaperName extends string | never = never,
|
55 | > = (event: NativeSyntheticEvent<T>) => void | Promise<void>;
|
56 |
|
57 |
|
58 | export type Double = number;
|
59 | export type Float = number;
|
60 | export type Int32 = number;
|
61 | export type UnsafeObject = object;
|
62 |
|
63 | type DefaultTypes = number | boolean | string | ReadonlyArray<string>;
|
64 |
|
65 |
|
66 |
|
67 |
|
68 |
|
69 |
|
70 | export type WithDefault<
|
71 | Type extends DefaultTypes,
|
72 | Value extends Type | string | undefined | null,
|
73 | > = Type | undefined | null;
|
74 | }
|