@ibgib/helper-gib
Version:
common helper/utils/etc used in ibgib libs. Node v19+ needed for heavily-used isomorphic webcrypto hashing consumed in both node and browsers.
65 lines • 1.75 kB
text/typescript
/**
* @deprecated
*
* use {@link tryRead}
* tries to read a file with the given path.
*
* @returns data of given file
*/
export declare function tryRead_node({ relOrAbsPath, }: {
/**
* path to try reading from
*/
relOrAbsPath: string;
}): Promise<string | undefined>;
export declare function tryRead({ relOrAbsPath, }: {
/**
* path to try reading from
*/
relOrAbsPath: string;
}): Promise<string | undefined>;
/**
* Very simple helper function.
*
* If wanting to do more analysis, just use `statSync` directly.
*
* @returns true if the `relOrAbsPath` is a file, else false.
*/
export declare function isFile({ relOrAbsPath, }: {
/**
* path to try reading from
*/
relOrAbsPath: string;
}): boolean;
export declare function promptForConfirm({ msg, yesLabel, noLabel, }: {
/**
* if provided, this is the message displayed when confirming.
*/
msg?: string;
yesLabel?: string;
noLabel?: string;
}): Promise<boolean>;
export declare function promptForBoolean({ msg, trueLabel, trueResponses, falseLabel, falseResponses, defaultNoMatchResult, warnOnUseDefault, }: {
/**
* if provided, this is the message displayed when confirming.
*/
msg: string;
trueLabel?: string;
trueResponses?: string[];
falseLabel?: string;
falseResponses?: string[];
defaultNoMatchResult?: boolean;
warnOnUseDefault?: boolean;
}): Promise<boolean>;
export declare function promptForSecret({ confirm, }: {
confirm: boolean;
}): Promise<string>;
/**
* @deprecated
*
* use {@link promptForSecret}
*/
export declare function promptForSecret_node({ confirm, }: {
confirm: boolean;
}): Promise<string>;
//# sourceMappingURL=node-helper.d.mts.map