Skip to content

Add typings #31

Description

@matthieusieben

I am currently using the following to type @hapi/vise. It would be nice if this module exported its own types. I d'ont have the time or resources to make a PR. Sorry about that.

// types.d.ts

declare module '@hapi/vise' {
  export class Vise {
    readonly length: number
    push(bhunk: Buffer): void
    readUInt8(pos: number): undefined | number
    at(pos: number): undefined | number
    chunks(): Buffer[]
    shift(length: number): Buffer[]
    startsWith(value: Buffer, pos?: number, length?: number): boolean
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew functionality or improvement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions