@salesforce/core
Version:
Core libraries to interact with SFDX projects, orgs, and APIs.
32 lines (31 loc) • 1.12 kB
TypeScript
type LockInitResponse = {
writeAndUnlock: (data: string) => Promise<void>;
unlock: () => Promise<void>;
};
type LockInitSyncResponse = {
writeAndUnlock: (data: string) => void;
unlock: () => void;
};
/**
*
*This method exists as a separate function so it can be used by ConfigFile OR outside of ConfigFile.
*
* @param filePath where to save the file
* @returns 2 functions:
* - writeAndUnlock: a function that takes the data to write and writes it to the file, then unlocks the file whether write succeeded or not
* - unlock: a function that unlocks the file (in case you don't end up calling writeAndUnlock)
*/
export declare const lockInit: (filePath: string) => Promise<LockInitResponse>;
/**
* prefer async {@link lockInit}.
* See its documentation for details.
*/
export declare const lockInitSync: (filePath: string) => LockInitSyncResponse;
/**
* Poll until the file is unlocked.
*
* @param filePath file path to check
*/
export declare const pollUntilUnlock: (filePath: string) => Promise<void>;
export declare const pollUntilUnlockSync: (filePath: string) => void;
export {};