@pulsesync/yamusic-types 0.2.0 → 0.4.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/dist/addonModules.d.ts +6 -7
- package/dist/index.d.ts +11 -0
- package/package.json +1 -1
package/dist/addonModules.d.ts
CHANGED
|
@@ -49,15 +49,14 @@ export interface AddonModuleResolution {
|
|
|
49
49
|
readonly descriptors: Readonly<Record<string, AddonModuleDescriptor>>;
|
|
50
50
|
readonly errors: Readonly<Record<string, AddonModuleErrorCode>>;
|
|
51
51
|
}
|
|
52
|
-
export interface
|
|
53
|
-
readonly
|
|
54
|
-
readonly
|
|
55
|
-
readonly expiresAt: number;
|
|
52
|
+
export interface AddonModuleFetchContext {
|
|
53
|
+
readonly descriptor: AddonModuleDescriptor;
|
|
54
|
+
readonly signal: AbortSignal;
|
|
56
55
|
}
|
|
57
56
|
export interface AddonModuleLoadOptions {
|
|
58
|
-
|
|
57
|
+
fetch: (context: AddonModuleFetchContext) => Promise<Uint8Array>;
|
|
59
58
|
}
|
|
60
59
|
export interface AddonModules {
|
|
61
|
-
load<T = unknown>(alias: string, options
|
|
62
|
-
instantiateWasm<T = Readonly<Record<string, (...args: never[]) => unknown>>>(alias: string, options
|
|
60
|
+
load<T = unknown>(alias: string, options: AddonModuleLoadOptions): Promise<T>;
|
|
61
|
+
instantiateWasm<T = Readonly<Record<string, (...args: never[]) => unknown>>>(alias: string, options: AddonModuleLoadOptions): Promise<T>;
|
|
63
62
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -492,3 +492,14 @@ export interface PulseSyncDesktopEvents {
|
|
|
492
492
|
invoke: <TResult = unknown>(name: string, ...args: unknown[]) => Promise<TResult>;
|
|
493
493
|
emit: (name: string, ...args: unknown[]) => unknown;
|
|
494
494
|
}
|
|
495
|
+
export type WebHostRequirements = {
|
|
496
|
+
readonly minHostApi?: number;
|
|
497
|
+
readonly capabilities?: readonly string[];
|
|
498
|
+
};
|
|
499
|
+
export type AddonLifecycle = {
|
|
500
|
+
readonly signal: AbortSignal;
|
|
501
|
+
readonly onCleanup: (cleanup: () => void) => () => void;
|
|
502
|
+
readonly setTimeout: (callback: () => void, delayMs: number) => () => void;
|
|
503
|
+
readonly setInterval: (callback: () => void, delayMs: number) => () => void;
|
|
504
|
+
readonly listen: (target: EventTarget, type: string, listener: EventListener, options?: AddEventListenerOptions) => () => void;
|
|
505
|
+
};
|