@scriptables/manifest
Version:
Utilities to generate, parse, and update manifest headers in Scriptable scripts.
17 lines (15 loc) • 580 B
text/typescript
type HeaderParser<T> = (headerLines: string[]) => T;
interface ParseOptions {
maxHeaderLines?: number;
headerNotices?: string[];
excludeNotices?: boolean;
}
interface ParsedScriptResult<T = never> {
header: T | null;
headerContent: string;
content: string;
}
declare function parse(script: string): ParsedScriptResult<never>;
declare function parse(script: string, options: ParseOptions): ParsedScriptResult<never>;
declare function parse<T>(script: string, headerParser: HeaderParser<T>, options?: ParseOptions): ParsedScriptResult<T>;
export { parse };