0.7.7 • Published 1 month ago
@types/dynamodb-lock-client v0.7.7
Installation
npm install --save @types/dynamodb-lock-client
Summary
This package contains type definitions for dynamodb-lock-client (https://github.com/tristanls/dynamodb-lock-client#readme).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/dynamodb-lock-client.
index.d.ts
// Type definitions for dynamodb-lock-client 0.7
// Project: https://github.com/tristanls/dynamodb-lock-client#readme
// Definitions by: RyoshiKayo <https://github.com/RyoshiKayo>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
import { DynamoDB } from "aws-sdk";
import { EventEmitter } from "events";
export interface Lock extends EventEmitter {
release(callback: (error: Error) => void): void;
fencingToken: number;
}
interface GenericConfig {
dynamodb: DynamoDB.DocumentClient;
lockTable: string;
partitionKey: string;
sortKey?: string | undefined;
owner?: string | undefined;
}
export interface FailClosedConfig extends GenericConfig {
acquirePeriodMs: number;
}
export interface FailOpenConfig extends GenericConfig {
heartbeatPeriodMs?: number | undefined;
leaseDurationMs: number;
trustLocalTime?: boolean | undefined;
}
export class LockClient<PartitionTableKeyType extends string | number> {
acquireLock(id: PartitionTableKeyType, callback: (error: Error, lock: Lock) => void): void;
}
export class FailClosed<PartitionTableKeyType extends string | number> extends LockClient<PartitionTableKeyType> {
constructor(config: FailClosedConfig);
}
export class FailOpen<PartitionTableKeyType extends string | number> extends LockClient<PartitionTableKeyType> {
constructor(config: FailOpenConfig);
}
// Disabled automatic exporting
export {};
Additional Details
- Last updated: Thu, 08 Jul 2021 12:01:00 GMT
- Dependencies: @types/aws-sdk, @types/node
- Global values: none
Credits
These definitions were written by RyoshiKayo.