-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreact-native.d.ts
More file actions
120 lines (113 loc) · 3.95 KB
/
Copy pathreact-native.d.ts
File metadata and controls
120 lines (113 loc) · 3.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
declare module "react-native" {
import * as React from "react";
export class View extends React.Component<any> {}
export class Text extends React.Component<any> {}
export class TextInput extends React.Component<any> {}
export class ScrollView extends React.Component<any> {}
export class KeyboardAvoidingView extends React.Component<any> {}
export class Modal extends React.Component<any> {}
export class TouchableOpacity extends React.Component<any> {}
export class TouchableWithoutFeedback extends React.Component<any> {}
export class Image extends React.Component<any> {}
export class Switch extends React.Component<any> {}
export class FlatList extends React.Component<any> {}
export class ActivityIndicator extends React.Component<any> {}
export class Keyboard {
static dismiss(): void;
}
export class StatusBar extends React.Component<any> {
static currentHeight?: number;
}
export class AppState {
static currentState: string;
static addEventListener(event: string, handler: Function): Subscription;
static removeListener(event: string, handler: Function): void;
}
export interface AlertButton {
text?: string;
onPress?: () => void;
style?: "default" | "cancel" | "destructive";
}
export class Alert {
static alert(title: string, message?: string, buttons?: AlertButton[]): void;
}
export class Share {
static share(content: {
message?: string;
url?: string;
title?: string;
}): Promise<{ action: string; activityType?: string | null }>;
static getSharedText?(): Promise<string>;
}
export class Dimensions {
static get(dim: string): { width: number; height: number };
}
export class StyleSheet {
static create<T>(styles: T): T;
}
export class Platform {
static OS: string;
static select<T>(obj: { ios?: T; android?: T; web?: T; default?: T }): T;
}
export class PixelRatio {
static get(): number;
}
export class NativeModules {}
export class LogBox {
static ignoreLogs(patterns: string[]): void;
}
export class AppRegistry {
static registerComponent(
appKey: string,
getComponent: () => React.ComponentType,
): void;
static runApplication(appKey: string, params: any): void;
}
export class DeviceEventEmitter {
static addListener(event: string, handler: Function): void;
static removeListener(event: string, handler: Function): void;
static emit(event: string, ...params: any[]): void;
}
export class NativeEventEmitter {
addListener(eventName: string, listener: Function): { remove: () => void };
removeAllListeners(eventName: string): void;
emit(eventName: string, ...params: any[]): void;
}
export class TurboModule {}
export class TurboModuleRegistry {
static get(moduleName: string): any;
}
// Animated API
export namespace Animated {
export class Value {
constructor(value: number);
setValue(value: number): void;
addListener(callback: (value: { value: number }) => void): string;
removeListener(id: string): void;
interpolate(config: any): any;
}
export class AnimatedAddition extends Value {}
export class AnimatedMultiplication extends Value {}
export function spring(value: Value, config: any): any;
export function timing(value: Value, config: any): any;
export function parallel(animations: any[]): any;
export function createAnimatedComponent(Component: any): any;
export const View: any;
}
// PanResponder
export class PanResponder {
static create(config: any): any;
}
export type ErrorHandlerCallback = (error: any, isFatal?: boolean) => void;
export class PlatformOSType {}
export class EXDevLauncher {}
export class StatusBarManager {}
export const NativeModules: {
[key: string]: any;
StatusBarManager?: StatusBarManager;
};
export interface ViewStyle {}
export interface TextStyle {}
export interface ImageStyle {}
export type StyleProp<T> = T | T[] | null | undefined;
}