execli
Version:
Generate task-oriented CLIs declaratively
65 lines • 2.19 kB
TypeScript
export type SharedContext = Readonly<{
concurrency: number;
}>;
export type Context<CustomContext> = SharedContext & Readonly<CustomContext>;
export type ContextLike<V = unknown> = Record<string, V>;
export type InternalOptionsContext = Context<{
dryRun: boolean;
from: string | undefined;
only: readonly string[];
skip: readonly string[];
tag: readonly string[];
until: string | undefined;
}>;
export type InternalContext = InternalOptionsContext & Readonly<{
secrets: readonly string[];
}>;
export declare const getUserContext: <CustomContext>(context: Readonly<{
concurrency: number;
}> & Readonly<CustomContext> & Readonly<{
dryRun: boolean;
from: string | undefined;
only: readonly string[];
skip: readonly string[];
tag: readonly string[];
until: string | undefined;
}> & Readonly<{
secrets: readonly string[];
}>) => Context<CustomContext>;
/** Hold a mutable reference to some context to prevent destructuring it too early. */
export type ContextHolder<C> = Readonly<{
add: (addedContext: Readonly<ContextLike>) => void;
addSecret: (secret: string) => void;
copy: () => ContextHolder<C>;
get: () => Context<C> & InternalContext;
}>;
export declare const createContextHolder: <C>(initialContext: Readonly<{
concurrency: number;
}> & Readonly<C> & Readonly<{
dryRun: boolean;
from: string | undefined;
only: readonly string[];
skip: readonly string[];
tag: readonly string[];
until: string | undefined;
}> & Readonly<{
secrets: readonly string[];
}>) => Readonly<{
add: (addedContext: Readonly<ContextLike>) => void;
addSecret: (secret: string) => void;
copy: () => Readonly<any>;
get: () => Readonly<{
concurrency: number;
}> & Readonly<C> & Readonly<{
dryRun: boolean;
from: string | undefined;
only: readonly string[];
skip: readonly string[];
tag: readonly string[];
until: string | undefined;
}> & Readonly<{
secrets: readonly string[];
}>;
}>;
export declare const hideSecrets: ({ secrets }: InternalContext, text: string) => string;
//# sourceMappingURL=context.d.ts.map