@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.
@@ -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 AddonModuleChallenge {
53
- readonly challenge: string;
54
- readonly moduleVersionId: string;
55
- readonly expiresAt: number;
52
+ export interface AddonModuleFetchContext {
53
+ readonly descriptor: AddonModuleDescriptor;
54
+ readonly signal: AbortSignal;
56
55
  }
57
56
  export interface AddonModuleLoadOptions {
58
- readonly authorize?: (challenge: AddonModuleChallenge) => Promise<string>;
57
+ fetch: (context: AddonModuleFetchContext) => Promise<Uint8Array>;
59
58
  }
60
59
  export interface AddonModules {
61
- load<T = unknown>(alias: string, options?: AddonModuleLoadOptions): Promise<T>;
62
- instantiateWasm<T = Readonly<Record<string, (...args: never[]) => unknown>>>(alias: string, options?: AddonModuleLoadOptions): Promise<T>;
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
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pulsesync/yamusic-types",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "description": "TypeScript declaration package for PulseSync YaMusic addon development",
5
5
  "repository": {
6
6
  "type": "git",