pseudoloc icon indicating copy to clipboard operation
pseudoloc copied to clipboard

Add Typescript type definition

Open mrcoles opened this issue 6 years ago • 0 comments

It’d be helpful to have a Typescript type definition file.

In the meantime I have the following in a declarations.d.ts file within my project:

declare module 'pseudoloc' {
  type Options = {
    prepend: string;
    append: string;
    delimiter: string;
    startDelimiter: string;
    endDelimiter: string;
    extend: number;
    override?: string;
  };

  export type PsuedolocOptions = Partial<Options>;

  export const version: string;
  export const option: Options;
  export function str(text: string): string;
}

It doesn’t expose everything, but it types the parts I’m currently using.

mrcoles avatar Sep 20 '19 23:09 mrcoles