You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
962 B
TypeScript

/**
* Content Script Interfaces
*/
export interface ContentModule {
setup: (args: ContentModuleSetupParams, wasm?: WebAssembly.Instance) => Promise<undefined>,
cleanup?: () => Promise<undefined>,
onThemeChange?: () => void,
}
export interface ContentModuleSetupParams {
[argName: string]: ResourceFileParam | string | undefined
}
export interface ScriptModule {
type: 'script',
name: string,
path: string,
}
export interface WasmModuleParam {
type: 'wasm',
name: string,
binaryPath: string,
textPath: string,
}
export interface ResourceFileParam {
type: 'resource',
name: string,
path: string,
}
export interface StringParam {
type: 'string',
value: string,
}
export type TransformResult = ScriptModule | WasmModuleParam | ResourceFileParam | StringParam
/**
* Resource transformer interfaces
*/
export interface PostResourceTransformer {
extension: string,
transform: (value: string) => Promise<TransformResult>
}