0.7.7 • Published 1 month ago

@types/dynamodb-lock-client v0.7.7

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

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

Credits

These definitions were written by RyoshiKayo.

0.7.7

1 month ago

0.7.6

6 months ago

0.7.5

7 months ago

0.7.4

8 months ago

0.7.3

8 months ago

0.7.2

1 year ago

0.7.1

3 years ago

0.7.0

3 years ago