3.0.11 • Published 6 months ago

@types/mongoose-sequence v3.0.11

Weekly downloads
2,050
License
MIT
Repository
github
Last release
6 months ago

Installation

npm install --save @types/mongoose-sequence

Summary

This package contains type definitions for mongoose-sequence (https://github.com/ramiel/mongoose-sequence).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mongoose-sequence.

index.d.ts

// Type definitions for mongoose-sequence 3.0.2
// Project: https://github.com/ramiel/mongoose-sequence
// Definitions by: Linus Brolin <https://github.com/linusbrolin>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 4.1

/// <reference types="mongoose" />

declare module 'mongoose' {
  export interface SequenceOptions {
    inc_field: string;                  // The name of the field to increment. Mandatory, default is _id
    id?: string | undefined;                        // Id of the sequence. Is mandatory only for scoped sequences but its use is strongly encouraged.
    reference_fields?: Array<string> | undefined;   // The field to reference for a scoped counter. Optional
    disable_hooks?: boolean | undefined;            // If true, the counter will not be incremented on saving a new document. Default to false
    collection_name?: string | undefined;           // By default the collection name to mantain the status of the counters is counters. You can override it using this option
  }

  export interface SequenceDocument extends Document {
    setNext(sequenceId: string, callback: (err: any, res: SequenceDocument) => void): void;
  }

  export interface SequenceSchema extends Schema {
    plugin(
      plugin: (schema: SequenceSchema, options: SequenceOptions) => void,
      options: SequenceOptions
    ): this;

    // overload for the default mongoose plugin function
    plugin(plugin: (schema: Schema, options?: Object) => void, opts?: Object): this;
  }
}

declare module 'mongoose-sequence' {
  import mongoose = require('mongoose');
  var _: (schema: mongoose.Schema, options?: Object) => void;
  export = _;
}

Additional Details

  • Last updated: Sun, 24 Apr 2022 14:31:47 GMT
  • Dependencies: none
  • Global values: none

Credits

These definitions were written by Linus Brolin.

3.0.10

6 months ago

3.0.11

6 months ago

3.0.8

8 months ago

3.0.9

7 months ago

3.0.7

2 years ago

3.0.6

3 years ago

3.0.5

3 years ago

3.0.4

4 years ago

3.0.3

7 years ago

3.0.2

7 years ago

3.0.1

8 years ago