Fix StartOS 0.4 TypeScript packaging to match SDK API

This commit is contained in:
MacPro
2026-04-09 15:10:44 -05:00
parent 68ec875ee7
commit 8298c083c7
3436 changed files with 867051 additions and 92 deletions
+37
View File
@@ -0,0 +1,37 @@
import { ExtendedVersion, VersionRange } from '../../../base/lib/exver';
import * as T from '../../../base/lib/types';
/**
* Function signature for an uninit handler that runs during service shutdown/uninstall.
*/
export type UninitFn = (effects: T.Effects,
/**
* @description the target version to prepare for
*
* on update: the canMigrateFrom of the new package
* on uninstall: null
* on shutdown: the current version
*/
target: VersionRange | ExtendedVersion | null) => Promise<void | null | undefined>;
/** Object form of an uninit handler — implements an `uninit()` method. */
export interface UninitScript {
uninit(effects: T.Effects,
/**
* @description the target version to prepare for
*
* on update: the canMigrateFrom of the new package
* on uninstall: null
* on shutdown: the current version
*/
target: VersionRange | ExtendedVersion | null): Promise<void>;
}
/** Either a {@link UninitScript} object or a {@link UninitFn} function. */
export type UninitScriptOrFn = UninitScript | UninitFn;
/**
* Composes multiple uninit handlers into a single `ExpectedExports.uninit`-compatible function.
* Handlers are executed sequentially in the order provided.
*
* @param uninits - One or more uninit handlers to compose
*/
export declare function setupUninit(...uninits: UninitScriptOrFn[]): T.ExpectedExports.uninit;
/** Normalizes a {@link UninitScriptOrFn} into a {@link UninitScript} object. */
export declare function setupOnUninit(onUninit: UninitScriptOrFn): UninitScript;