@unbound-app/api 0.5.1 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/_internal.d.ts +196 -1
- package/src/global.d.ts +31 -114
- package/src/metro/index.d.ts +3 -2
- package/src/native.d.ts +52 -3
package/package.json
CHANGED
package/src/_internal.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ declare const TRANSITION_STATE_KEYS: readonly ['MOUNTED', 'ENTERED', 'YEETED'];
|
|
|
26
26
|
export interface Addon {
|
|
27
27
|
started: boolean;
|
|
28
28
|
instance: any;
|
|
29
|
+
context?: PluginContext;
|
|
29
30
|
id: string;
|
|
30
31
|
failed: boolean;
|
|
31
32
|
data: AddonManifest;
|
|
@@ -50,6 +51,8 @@ export interface AddonManifest {
|
|
|
50
51
|
folder: string;
|
|
51
52
|
path: string;
|
|
52
53
|
url: string;
|
|
54
|
+
capabilities?: NativePluginCapability[];
|
|
55
|
+
minNativePluginApi?: string;
|
|
53
56
|
}
|
|
54
57
|
/** The native module used to register and resolve {@link DiscordAsset}s by id. */
|
|
55
58
|
export interface AssetsModule {
|
|
@@ -188,6 +191,146 @@ export interface InternalToastOptions extends ToastOptions {
|
|
|
188
191
|
closing?: boolean;
|
|
189
192
|
date?: number;
|
|
190
193
|
}
|
|
194
|
+
export interface NativeCallOptions {
|
|
195
|
+
thread?: NativeThreadPolicy;
|
|
196
|
+
}
|
|
197
|
+
export interface NativeFFIBridge {
|
|
198
|
+
symbol(name: string, image?: string): NativePointer | null;
|
|
199
|
+
call(pointer: NativePointer, signature: NativeFFISignature, ...args: unknown[]): unknown;
|
|
200
|
+
}
|
|
201
|
+
export interface NativeFFISignature {
|
|
202
|
+
returnType: NativeFFIType;
|
|
203
|
+
args: NativeFFIType[];
|
|
204
|
+
}
|
|
205
|
+
export interface NativeFabricBridge {
|
|
206
|
+
mount(
|
|
207
|
+
container: NativeObjectHandle,
|
|
208
|
+
moduleName: string,
|
|
209
|
+
properties?: Record<string, unknown>,
|
|
210
|
+
): NativeFabricSurface;
|
|
211
|
+
update(surface: NativeFabricSurface, properties: Record<string, unknown>): void;
|
|
212
|
+
setSize(
|
|
213
|
+
surface: NativeFabricSurface,
|
|
214
|
+
minimumSize: NativeFabricSize,
|
|
215
|
+
maximumSize: NativeFabricSize,
|
|
216
|
+
): void;
|
|
217
|
+
setFrame(surface: NativeFabricSurface, frame: NativeFabricFrame): void;
|
|
218
|
+
measure(view: NativeObjectHandle): NativeFabricFrame;
|
|
219
|
+
unmount(surface: NativeFabricSurface): void;
|
|
220
|
+
}
|
|
221
|
+
export interface NativeFabricFrame {
|
|
222
|
+
x: number;
|
|
223
|
+
y: number;
|
|
224
|
+
width: number;
|
|
225
|
+
height: number;
|
|
226
|
+
}
|
|
227
|
+
export interface NativeFabricSize {
|
|
228
|
+
width: number;
|
|
229
|
+
height: number;
|
|
230
|
+
}
|
|
231
|
+
export interface NativeHookContext {
|
|
232
|
+
self: NativeObjectHandle;
|
|
233
|
+
selector: string;
|
|
234
|
+
args: unknown[];
|
|
235
|
+
original: (...args: unknown[]) => unknown;
|
|
236
|
+
replaceObjectArgument(index: number, value: NativeObjectHandle | null): void;
|
|
237
|
+
}
|
|
238
|
+
export interface NativeHookHandlers {
|
|
239
|
+
before?: (context: NativeHookContext) => void | Promise<void>;
|
|
240
|
+
after?: (context: NativeHookContext) => void | Promise<void>;
|
|
241
|
+
replace?: (context: NativeHookContext) => unknown;
|
|
242
|
+
}
|
|
243
|
+
export interface NativeHookOptions extends NativeCallOptions {
|
|
244
|
+
cacheOnly?: boolean;
|
|
245
|
+
instance?: NativeObjectHandle;
|
|
246
|
+
once?: boolean;
|
|
247
|
+
}
|
|
248
|
+
export interface NativeHookToken {
|
|
249
|
+
readonly active: boolean;
|
|
250
|
+
setReturnValue(self: NativeObjectHandle, args: unknown[], value: unknown): void;
|
|
251
|
+
removeReturnValue(self: NativeObjectHandle, args: unknown[]): void;
|
|
252
|
+
clearReturnValues(): void;
|
|
253
|
+
remove(): void;
|
|
254
|
+
}
|
|
255
|
+
export interface NativeObjCBridge {
|
|
256
|
+
getClass(name: string): NativeClassHandle | null;
|
|
257
|
+
alloc(classOrName: string | NativeClassHandle): NativeObjectHandle;
|
|
258
|
+
className(handle: NativeHandle): string | null;
|
|
259
|
+
respondsTo(handle: NativeHandle, selector: string): boolean;
|
|
260
|
+
call(handle: NativeHandle, selector: string, ...args: unknown[]): unknown;
|
|
261
|
+
callSuper(
|
|
262
|
+
handle: NativeObjectHandle,
|
|
263
|
+
currentClass: NativeClassHandle | string,
|
|
264
|
+
selector: string,
|
|
265
|
+
...args: unknown[]
|
|
266
|
+
): unknown;
|
|
267
|
+
invoke(
|
|
268
|
+
handle: NativeObjectHandle,
|
|
269
|
+
selector: string,
|
|
270
|
+
args: unknown[],
|
|
271
|
+
options?: NativeCallOptions,
|
|
272
|
+
): unknown;
|
|
273
|
+
invokeSuper(
|
|
274
|
+
handle: NativeObjectHandle,
|
|
275
|
+
currentClass: NativeClassHandle | string,
|
|
276
|
+
selector: string,
|
|
277
|
+
args: unknown[],
|
|
278
|
+
options?: NativeCallOptions,
|
|
279
|
+
): unknown;
|
|
280
|
+
getIvar(handle: NativeObjectHandle, name: string): unknown;
|
|
281
|
+
setIvar(handle: NativeObjectHandle, name: string, value: unknown): void;
|
|
282
|
+
createAssociationKey(): NativeAssociationKey;
|
|
283
|
+
getAssociatedObject(handle: NativeObjectHandle, key: NativeAssociationKey): unknown;
|
|
284
|
+
setAssociatedObject(
|
|
285
|
+
handle: NativeObjectHandle,
|
|
286
|
+
key: NativeAssociationKey,
|
|
287
|
+
value: unknown,
|
|
288
|
+
policy?: string,
|
|
289
|
+
): void;
|
|
290
|
+
struct<T extends object = Record<string, unknown>>(name: string, fields: T): NativeStruct<T>;
|
|
291
|
+
array(handle: NativeObjectHandle): unknown[];
|
|
292
|
+
data(value: ArrayBuffer | Uint8Array): NativeObjectHandle;
|
|
293
|
+
hook(
|
|
294
|
+
className: string,
|
|
295
|
+
selector: string,
|
|
296
|
+
handlers: NativeHookHandlers,
|
|
297
|
+
options?: NativeHookOptions,
|
|
298
|
+
): NativeHookToken;
|
|
299
|
+
}
|
|
300
|
+
export interface NativePlatformApp {
|
|
301
|
+
getAppSource(): string;
|
|
302
|
+
}
|
|
303
|
+
export interface NativePlatformBridge {
|
|
304
|
+
evaluateBytecode(bytecode: ArrayBuffer, tag?: string): unknown;
|
|
305
|
+
readonly device: NativePlatformDevice;
|
|
306
|
+
readonly app: NativePlatformApp;
|
|
307
|
+
}
|
|
308
|
+
export interface NativePlatformDevice {
|
|
309
|
+
getDeviceModel(): string;
|
|
310
|
+
getiOSVersionString(): string;
|
|
311
|
+
isJailbroken(): boolean;
|
|
312
|
+
isSystemApp(): boolean;
|
|
313
|
+
isVerifiedBuild(): boolean;
|
|
314
|
+
getEntitlements(): Record<string, any>;
|
|
315
|
+
getEntitlementsAsPlist(): string;
|
|
316
|
+
}
|
|
317
|
+
export interface NativePluginBridge {
|
|
318
|
+
readonly apiVersion: string;
|
|
319
|
+
readonly abiVersion: string;
|
|
320
|
+
readonly capabilities: readonly NativePluginCapability[];
|
|
321
|
+
readonly objc: NativeObjCBridge;
|
|
322
|
+
readonly ffi: NativeFFIBridge;
|
|
323
|
+
readonly fabric: NativeFabricBridge;
|
|
324
|
+
}
|
|
325
|
+
export interface NativePluginError {
|
|
326
|
+
code: NativePluginErrorCode;
|
|
327
|
+
message: string;
|
|
328
|
+
capability?: NativePluginCapability;
|
|
329
|
+
}
|
|
330
|
+
export interface NativeStruct<T extends object = Record<string, unknown>> extends NativeHandle {
|
|
331
|
+
readonly name: string;
|
|
332
|
+
readonly value?: T;
|
|
333
|
+
}
|
|
191
334
|
export interface Navigation<T = any> {
|
|
192
335
|
push: (route: string, params?: T) => void;
|
|
193
336
|
pop: () => void;
|
|
@@ -197,6 +340,13 @@ export interface Navigation<T = any> {
|
|
|
197
340
|
addListener: (event: string, callback: Fn) => Fn<void>;
|
|
198
341
|
[key: string]: any;
|
|
199
342
|
}
|
|
343
|
+
export interface PluginContext {
|
|
344
|
+
readonly manifest: AddonManifest;
|
|
345
|
+
readonly id: string;
|
|
346
|
+
readonly capabilities: readonly NativePluginCapability[];
|
|
347
|
+
readonly native: NativePluginBridge;
|
|
348
|
+
dispose(): void;
|
|
349
|
+
}
|
|
200
350
|
export interface RowButtonProps {
|
|
201
351
|
label?: ReactNode;
|
|
202
352
|
icon?: ReactNode;
|
|
@@ -536,6 +686,51 @@ export type IconSlot = ReactNode | ComponentType<any> | Fn<ReactNode>;
|
|
|
536
686
|
export type InputSize = LiteralUnion<'sm' | 'md' | 'lg'>;
|
|
537
687
|
/** Input status. `focused` is an internal state and is not user-settable. */
|
|
538
688
|
export type InputStatus = LiteralUnion<'default' | 'error'>;
|
|
689
|
+
export type NativeAssociationKey = NativeHandle;
|
|
690
|
+
export type NativeClassHandle = NativeHandle;
|
|
691
|
+
export type NativeFFIType =
|
|
692
|
+
| NativeFFITypeName
|
|
693
|
+
| {
|
|
694
|
+
struct: string;
|
|
695
|
+
};
|
|
696
|
+
export type NativeFFITypeName =
|
|
697
|
+
| 'void'
|
|
698
|
+
| 'bool'
|
|
699
|
+
| 'i8'
|
|
700
|
+
| 'u8'
|
|
701
|
+
| 'i16'
|
|
702
|
+
| 'u16'
|
|
703
|
+
| 'i32'
|
|
704
|
+
| 'u32'
|
|
705
|
+
| 'i64'
|
|
706
|
+
| 'u64'
|
|
707
|
+
| 'float'
|
|
708
|
+
| 'double'
|
|
709
|
+
| 'cstring'
|
|
710
|
+
| 'pointer'
|
|
711
|
+
| 'object'
|
|
712
|
+
| 'class'
|
|
713
|
+
| 'selector';
|
|
714
|
+
export type NativeFabricSurface = NativeHandle;
|
|
715
|
+
export type NativeHandle = object;
|
|
716
|
+
export type NativeObjectHandle = NativeHandle;
|
|
717
|
+
export type NativePluginCapability =
|
|
718
|
+
| 'native.objc.classes'
|
|
719
|
+
| 'native.objc.invoke'
|
|
720
|
+
| 'native.objc.ivars'
|
|
721
|
+
| 'native.objc.associations'
|
|
722
|
+
| 'native.objc.hooks'
|
|
723
|
+
| 'native.ffi.symbols'
|
|
724
|
+
| 'native.ffi.call'
|
|
725
|
+
| 'native.fabric.mount';
|
|
726
|
+
export type NativePluginErrorCode =
|
|
727
|
+
| 'NATIVE_BRIDGE_ERROR'
|
|
728
|
+
| 'NATIVE_PLUGIN_API_VERSION_UNSUPPORTED'
|
|
729
|
+
| 'NATIVE_PLUGIN_CAPABILITY_DENIED'
|
|
730
|
+
| 'NATIVE_PLUGIN_SCOPE_DISPOSED'
|
|
731
|
+
| 'NATIVE_PLUGIN_UNAVAILABLE';
|
|
732
|
+
export type NativePointer = NativeHandle;
|
|
733
|
+
export type NativeThreadPolicy = 'current' | 'main';
|
|
539
734
|
/** An {@link Addon} whose instance is a {@link Plugin}. */
|
|
540
735
|
export type PluginEntity = Addon & {
|
|
541
736
|
instance: Plugin$1 | null;
|
|
@@ -621,7 +816,7 @@ export type UnboundAsset = DiscordAsset & {
|
|
|
621
816
|
|
|
622
817
|
/** The lifecycle and settings contract implemented by a plugin. */
|
|
623
818
|
interface Plugin$1 {
|
|
624
|
-
start?(): void;
|
|
819
|
+
start?(context?: PluginContext): void;
|
|
625
820
|
stop?(): void;
|
|
626
821
|
getSettingsPanel?(): ReactNode;
|
|
627
822
|
}
|
package/src/global.d.ts
CHANGED
|
@@ -27,8 +27,37 @@ export type {
|
|
|
27
27
|
InputSize,
|
|
28
28
|
InputStatus,
|
|
29
29
|
InternalToastOptions,
|
|
30
|
+
NativeAssociationKey,
|
|
31
|
+
NativeCallOptions,
|
|
32
|
+
NativeClassHandle,
|
|
33
|
+
NativeFFIBridge,
|
|
34
|
+
NativeFFISignature,
|
|
35
|
+
NativeFFIType,
|
|
36
|
+
NativeFFITypeName,
|
|
37
|
+
NativeFabricBridge,
|
|
38
|
+
NativeFabricFrame,
|
|
39
|
+
NativeFabricSize,
|
|
40
|
+
NativeFabricSurface,
|
|
41
|
+
NativeHandle,
|
|
42
|
+
NativeHookContext,
|
|
43
|
+
NativeHookHandlers,
|
|
44
|
+
NativeHookOptions,
|
|
45
|
+
NativeHookToken,
|
|
46
|
+
NativeObjCBridge,
|
|
47
|
+
NativeObjectHandle,
|
|
48
|
+
NativePlatformApp,
|
|
49
|
+
NativePlatformBridge,
|
|
50
|
+
NativePlatformDevice,
|
|
51
|
+
NativePluginBridge,
|
|
52
|
+
NativePluginCapability,
|
|
53
|
+
NativePluginError,
|
|
54
|
+
NativePluginErrorCode,
|
|
55
|
+
NativePointer,
|
|
56
|
+
NativeStruct,
|
|
57
|
+
NativeThreadPolicy,
|
|
30
58
|
Navigation,
|
|
31
59
|
Plugin,
|
|
60
|
+
PluginContext,
|
|
32
61
|
PluginEntity,
|
|
33
62
|
ResolvedStyles,
|
|
34
63
|
RowButtonProps,
|
|
@@ -68,127 +97,15 @@ export type {
|
|
|
68
97
|
TransitionState,
|
|
69
98
|
UnboundAsset,
|
|
70
99
|
} from './_internal';
|
|
71
|
-
import type {
|
|
100
|
+
import type { NativePlatformBridge } from './_internal';
|
|
72
101
|
declare global {
|
|
73
|
-
/** A feature name published by the native module's capability table. */
|
|
74
|
-
type UnboundNativeFeature =
|
|
75
|
-
| 'device.info'
|
|
76
|
-
| 'device.entitlements'
|
|
77
|
-
| 'app.source'
|
|
78
|
-
| 'notifications'
|
|
79
|
-
| 'pip.video'
|
|
80
|
-
| 'chat.avatar'
|
|
81
|
-
| 'chat.messageBubbles'
|
|
82
|
-
| 'toolbox.menu'
|
|
83
|
-
| 'native.evaluateBytecode';
|
|
84
|
-
/**
|
|
85
|
-
* The lifecycle status of a native feature on the running build. `unknown` and `unavailable`
|
|
86
|
-
* both mean "do not call"; only `supported` and `deprecated` are safe.
|
|
87
|
-
*/
|
|
88
|
-
type UnboundNativeFeatureStatus =
|
|
89
|
-
| 'unknown'
|
|
90
|
-
| 'removed'
|
|
91
|
-
| 'deprecated'
|
|
92
|
-
| 'supported'
|
|
93
|
-
| 'unavailable';
|
|
94
|
-
/**
|
|
95
|
-
* The full metadata record for a native feature. Everything but `name` and `known` is absent
|
|
96
|
-
* when the feature is not in this build's table.
|
|
97
|
-
*/
|
|
98
|
-
type UnboundNativeFeatureInfo = {
|
|
99
|
-
name: string;
|
|
100
|
-
known: boolean;
|
|
101
|
-
status: UnboundNativeFeatureStatus;
|
|
102
|
-
supported?: boolean;
|
|
103
|
-
introducedIn?: string;
|
|
104
|
-
deprecatedIn?: string;
|
|
105
|
-
removedIn?: string;
|
|
106
|
-
replacement?: UnboundNativeFeature;
|
|
107
|
-
};
|
|
108
|
-
/** Hardware, OS, and install-integrity details for the device Unbound is running on. */
|
|
109
|
-
type UnboundNativeDevice = {
|
|
110
|
-
getModel(): string;
|
|
111
|
-
getiOSVersionString(): string;
|
|
112
|
-
isJailbroken(): boolean;
|
|
113
|
-
isSystemApp(): boolean;
|
|
114
|
-
isVerifiedBuild(): boolean;
|
|
115
|
-
getEntitlements(): Record<string, any>;
|
|
116
|
-
getEntitlementsAsPlist(): string;
|
|
117
|
-
};
|
|
118
|
-
/** How this copy of the app was installed. */
|
|
119
|
-
type UnboundNativeApp = {
|
|
120
|
-
getSource(): string;
|
|
121
|
-
};
|
|
122
|
-
/** Local notification scheduling. */
|
|
123
|
-
type UnboundNativeNotifications = {
|
|
124
|
-
show(
|
|
125
|
-
title?: string,
|
|
126
|
-
body?: string,
|
|
127
|
-
timeDelay?: number,
|
|
128
|
-
soundEnabled?: boolean,
|
|
129
|
-
identifier?: string,
|
|
130
|
-
): string;
|
|
131
|
-
};
|
|
132
|
-
/** Picture-in-picture video playback. */
|
|
133
|
-
type UnboundNativePiP = {
|
|
134
|
-
playVideo(url: string): string | null;
|
|
135
|
-
};
|
|
136
|
-
/**
|
|
137
|
-
* Native chat appearance controls. The getters read synchronously; every setter hops to the
|
|
138
|
-
* main queue and returns immediately, so a value read back on the next line may still be stale.
|
|
139
|
-
*/
|
|
140
|
-
type UnboundNativeChat = {
|
|
141
|
-
getAvatarCornerRadius(): number;
|
|
142
|
-
setAvatarCornerRadius(radius?: number): void;
|
|
143
|
-
resetAvatarCornerRadius(): void;
|
|
144
|
-
getMessageBubblesEnabled(): boolean;
|
|
145
|
-
getMessageBubbleLightColor(): ColorString;
|
|
146
|
-
getMessageBubbleDarkColor(): ColorString;
|
|
147
|
-
getMessageBubbleCornerRadius(): number;
|
|
148
|
-
setMessageBubblesEnabled(
|
|
149
|
-
enabled: boolean,
|
|
150
|
-
lightColor?: ColorString,
|
|
151
|
-
darkColor?: ColorString,
|
|
152
|
-
): void;
|
|
153
|
-
setMessageBubbleColors(lightColor?: ColorString, darkColor?: ColorString): void;
|
|
154
|
-
setMessageBubbleCornerRadius(radius?: number): void;
|
|
155
|
-
resetMessageBubbles(): void;
|
|
156
|
-
};
|
|
157
|
-
/** The native toolbox menu, drawn natively so it survives a broken JS bundle. */
|
|
158
|
-
type UnboundNativeToolbox = {
|
|
159
|
-
showMenu(): void;
|
|
160
|
-
};
|
|
161
|
-
/** The raw `UnboundNative` JSI bridge the tweak installs directly on the JS global. */
|
|
162
|
-
type UnboundNativeModule = {
|
|
163
|
-
getNativeModuleVersion(): string;
|
|
164
|
-
supportsFeature(name: UnboundNativeFeature): boolean;
|
|
165
|
-
getFeatureInfo(name: UnboundNativeFeature): UnboundNativeFeatureInfo;
|
|
166
|
-
isFeatureDeprecated(name: UnboundNativeFeature): boolean;
|
|
167
|
-
isFeatureRemoved(name: UnboundNativeFeature): boolean;
|
|
168
|
-
getSupportedFeatures(): UnboundNativeFeature[];
|
|
169
|
-
getDeprecatedFeatures(): UnboundNativeFeature[];
|
|
170
|
-
getRemovedFeatures(): UnboundNativeFeature[];
|
|
171
|
-
/**
|
|
172
|
-
* Runs Hermes bytecode in the app's JS runtime and returns whatever it evaluates to.
|
|
173
|
-
* Throws when the buffer is not an `ArrayBuffer`, is empty, or is not Hermes bytecode;
|
|
174
|
-
* anything the bytecode itself throws propagates too.
|
|
175
|
-
*/
|
|
176
|
-
evaluateBytecode(bytecode: ArrayBuffer, tag?: string): any;
|
|
177
|
-
device: UnboundNativeDevice;
|
|
178
|
-
app: UnboundNativeApp;
|
|
179
|
-
notifications: UnboundNativeNotifications;
|
|
180
|
-
pip: UnboundNativePiP;
|
|
181
|
-
chat: UnboundNativeChat;
|
|
182
|
-
toolbox: UnboundNativeToolbox;
|
|
183
|
-
};
|
|
184
102
|
/**
|
|
185
103
|
* Build-time token, replaced with a boolean literal by the build's `transform.define`. Folds at
|
|
186
104
|
* the module-graph level so `if ($$DEV$$)` branches (and any imports inside them) are dead-code
|
|
187
105
|
* eliminated from production bundles entirely. Use it (not a runtime check) to gate dev-only code.
|
|
188
106
|
*/
|
|
189
107
|
var $$DEV$$: boolean;
|
|
190
|
-
|
|
191
|
-
var UnboundNative: UnboundNativeModule | undefined;
|
|
108
|
+
var NativePlatform: NativePlatformBridge | undefined;
|
|
192
109
|
var React: typeof import('react');
|
|
193
110
|
var ReactNative: typeof import('react-native');
|
|
194
111
|
|
package/src/metro/index.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export declare const on: typeof addListener;
|
|
|
20
20
|
* @param listener Callback receiving the module exports and its id.
|
|
21
21
|
* @returns A function that removes the listener.
|
|
22
22
|
*/
|
|
23
|
-
export declare function addListener(listener: (mdl: any, id:
|
|
23
|
+
export declare function addListener(listener: (mdl: any, id: number) => void): () => boolean;
|
|
24
24
|
/**
|
|
25
25
|
* @description Runs several filters in a single registry pass, returning one result per item.
|
|
26
26
|
* @param items The filters to resolve, each with its own per-item options.
|
|
@@ -108,7 +108,7 @@ export declare function initializeModule(id: number): boolean;
|
|
|
108
108
|
* @description Removes a previously registered module listener.
|
|
109
109
|
* @param listener The listener to remove.
|
|
110
110
|
*/
|
|
111
|
-
export declare function removeListener(listener: (mdl: any, id:
|
|
111
|
+
export declare function removeListener(listener: (mdl: any, id: number) => void): void;
|
|
112
112
|
|
|
113
113
|
/** A single entry in a {@link bulk} search: a filter plus its per-item options. */
|
|
114
114
|
export interface MetroBulkItem extends Omit<MetroSearchOptions, 'initial' | 'cache'> {
|
|
@@ -191,6 +191,7 @@ export type MetroSearchOptions = {
|
|
|
191
191
|
lazy?: boolean;
|
|
192
192
|
raw?: boolean;
|
|
193
193
|
all?: boolean;
|
|
194
|
+
cacheOnly?: boolean;
|
|
194
195
|
initialize?: boolean;
|
|
195
196
|
};
|
|
196
197
|
/** Result shape of a by-name search: the matched function (or its default export). */
|
package/src/native.d.ts
CHANGED
|
@@ -1,8 +1,55 @@
|
|
|
1
1
|
// Auto-generated by generate-plugin-sdk.ts - DO NOT EDIT
|
|
2
2
|
|
|
3
|
+
export type {
|
|
4
|
+
NativeAssociationKey,
|
|
5
|
+
NativeCallOptions,
|
|
6
|
+
NativeClassHandle,
|
|
7
|
+
NativeFFIBridge,
|
|
8
|
+
NativeFFISignature,
|
|
9
|
+
NativeFFIType,
|
|
10
|
+
NativeFFITypeName,
|
|
11
|
+
NativeFabricBridge,
|
|
12
|
+
NativeFabricFrame,
|
|
13
|
+
NativeFabricSize,
|
|
14
|
+
NativeFabricSurface,
|
|
15
|
+
NativeHandle,
|
|
16
|
+
NativeHookContext,
|
|
17
|
+
NativeHookHandlers,
|
|
18
|
+
NativeHookOptions,
|
|
19
|
+
NativeHookToken,
|
|
20
|
+
NativeObjCBridge,
|
|
21
|
+
NativeObjectHandle,
|
|
22
|
+
NativePlatformBridge,
|
|
23
|
+
NativePluginBridge,
|
|
24
|
+
NativePluginCapability,
|
|
25
|
+
NativePluginError,
|
|
26
|
+
NativePluginErrorCode,
|
|
27
|
+
NativePointer,
|
|
28
|
+
NativeStruct,
|
|
29
|
+
NativeThreadPolicy,
|
|
30
|
+
PluginContext,
|
|
31
|
+
} from './_internal';
|
|
32
|
+
import type { NativePlatformBridge, NativePluginCapability } from './_internal';
|
|
3
33
|
import type { Fn, PromiseFn } from './utils';
|
|
4
|
-
|
|
5
|
-
declare
|
|
34
|
+
declare const NativePlatform$1: NativePlatformBridge | undefined;
|
|
35
|
+
export declare class NativePluginCapabilityError extends Error {
|
|
36
|
+
readonly code = 'NATIVE_PLUGIN_CAPABILITY_DENIED';
|
|
37
|
+
readonly capability: NativePluginCapability;
|
|
38
|
+
constructor(capability: NativePluginCapability);
|
|
39
|
+
}
|
|
40
|
+
export declare class NativePluginDisposedError extends Error {
|
|
41
|
+
readonly code = 'NATIVE_PLUGIN_SCOPE_DISPOSED';
|
|
42
|
+
constructor();
|
|
43
|
+
}
|
|
44
|
+
export declare class NativePluginUnavailableError extends Error {
|
|
45
|
+
readonly code = 'NATIVE_PLUGIN_UNAVAILABLE';
|
|
46
|
+
}
|
|
47
|
+
export declare class NativePluginVersionError extends Error {
|
|
48
|
+
readonly code = 'NATIVE_PLUGIN_API_VERSION_UNSUPPORTED';
|
|
49
|
+
readonly installedApi: string;
|
|
50
|
+
readonly requiredApi: string;
|
|
51
|
+
constructor(requiredApi: string, installedApi: string);
|
|
52
|
+
}
|
|
6
53
|
/** The resolved native client info module, exposing build and release metadata. */
|
|
7
54
|
export declare const BundleInfo: BundleInfoType;
|
|
8
55
|
/** The resolved native bundle updater module, used to check for updates and reload the bundle. */
|
|
@@ -27,6 +74,7 @@ export declare function getRuntimeProperties(): Record<string, any>;
|
|
|
27
74
|
* @description Persists pending settings to storage, then reloads the native bundle.
|
|
28
75
|
*/
|
|
29
76
|
export declare function reload(): Promise<void>;
|
|
77
|
+
|
|
30
78
|
/** Build and release metadata reported by the native client info module. */
|
|
31
79
|
export interface BundleInfoType {
|
|
32
80
|
Version: string;
|
|
@@ -90,6 +138,7 @@ export interface DeviceInfoType {
|
|
|
90
138
|
ramSize: string;
|
|
91
139
|
device: string;
|
|
92
140
|
}
|
|
141
|
+
|
|
93
142
|
/** The text encodings accepted by the native `DCDFileManager` read/write operations. */
|
|
94
143
|
export type DCDFileManagerEncoding = 'utf-8' | 'utf8' | 'base64';
|
|
95
|
-
export {
|
|
144
|
+
export { NativePlatform$1 as NativePlatform };
|