elwerene / libreoffice-convert

MIT License
241 stars 94 forks source link

@types support? #58

Closed u007 closed 2 years ago

u007 commented 2 years ago

hi,

can we have @types support for typescript? currently im using this:

declare module 'libreoffice-convert' {
  export const convertWithOptions = (document: string, format: string,
  filter: string, options = {tmpOptions? : {}, asyncOptions? : {}}, 
  callback: (err: Error | undefined, any) => {

  }) => {}

  export const convert = (document: string, format: string,
  filter: string | undefined, callback: (err: Error | undefined, any) => {

  }) => {}
}
elwerene commented 2 years ago

Sure, please provide a pull request. I will review it and create a new version :)

Am 3. August 2021 18:34:26 MESZ schrieb James @.***>:

hi,

can we have @types support for typescript? currently im using this:

declare module 'libreoffice-convert' {
 export const convertWithOptions = (document: string, format: string,
 filter: string, options = {tmpOptions? : {}, asyncOptions? : {}}, 
 callback: (err: Error | undefined, any) => {

 }) => {}

 export const convert = (document: string, format: string,
 filter: string | undefined, callback: (err: Error | undefined, any) => {

 }) => {}
}
mingkyme commented 2 years ago

I tried this code and worked.

declare module 'libreoffice-convert' {
    export const convert = (document: Buffer, format: string,
        filter: string | undefined, callback: (err: Error | undefined, any) => void) => { }
}
elwerene commented 2 years ago

If have no idea about typescript myself. I mostly switched to rust :shrug: So lets release this :)