index.d.ts 499 B

123456789101112131415161718192021222324252627
  1. declare function hyperid(opts?: boolean | hyperid.Options): hyperid.Instance
  2. declare namespace hyperid {
  3. const decode: hyperid.decode
  4. interface Options {
  5. urlSafe?: boolean
  6. fixedLength?: boolean
  7. startFrom?: number
  8. maxInt?: number
  9. }
  10. interface Instance {
  11. (): string
  12. decode: hyperid.decode
  13. uuid: string
  14. }
  15. type decode = (id: string, opts?: hyperid.Options) => hyperid.IdObject
  16. interface IdObject {
  17. uuid: string
  18. count: number
  19. }
  20. }
  21. export = hyperid