summaryrefslogtreecommitdiff
path: root/cli/dts/lib.deno.ns.d.ts
diff options
context:
space:
mode:
authorTilman Roeder <dyed.green.info@gmail.com>2021-08-24 14:21:31 +0100
committerGitHub <noreply@github.com>2021-08-24 15:21:31 +0200
commit93d83a84dbe1f6ecf93b596f88bc85ba378fa986 (patch)
tree8f9165f29064b0eb6d34661577877ebc2a3e37b3 /cli/dts/lib.deno.ns.d.ts
parent46e4ba38b2b1ccee8d3b4f04be1a2cc0b42cd52a (diff)
feat(unstable): Add file locking APIs (#11746)
This commit adds following unstable APIs: - Deno.flock() - Deno.flockSync() - Deno.funlock() - Deno.funlockSync()
Diffstat (limited to 'cli/dts/lib.deno.ns.d.ts')
-rw-r--r--cli/dts/lib.deno.ns.d.ts26
1 files changed, 26 insertions, 0 deletions
diff --git a/cli/dts/lib.deno.ns.d.ts b/cli/dts/lib.deno.ns.d.ts
index 420a08da4..996aff363 100644
--- a/cli/dts/lib.deno.ns.d.ts
+++ b/cli/dts/lib.deno.ns.d.ts
@@ -787,6 +787,32 @@ declare namespace Deno {
*/
export function fdatasync(rid: number): Promise<void>;
+ /** **UNSTABLE**: New API should be tested first.
+ *
+ * Acquire an advisory file-system lock for the provided file. `exclusive`
+ * defaults to `false`.
+ */
+ export function flock(rid: number, exclusive?: boolean): Promise<void>;
+
+ /** **UNSTABLE**: New API should be tested first.
+ *
+ * Acquire an advisory file-system lock for the provided file. `exclusive`
+ * defaults to `false`.
+ */
+ export function flockSync(rid: number, exclusive?: boolean): void;
+
+ /** **UNSTABLE**: New API should be tested first.
+ *
+ * Release an advisory file-system lock for the provided file.
+ */
+ export function funlock(rid: number): Promise<void>;
+
+ /** **UNSTABLE**: New API should be tested first.
+ *
+ * Release an advisory file-system lock for the provided file.
+ */
+ export function funlockSync(rid: number): void;
+
/** Close the given resource ID (rid) which has been previously opened, such
* as via opening or creating a file. Closing a file when you are finished
* with it is important to avoid leaking resources.