0

A have written a nativescript plugin using the official plugin seed from github

It's a very simple plugin and has only 2 source files:

  1. index.ts
  2. index.d.ts

(and a native library)

In index.ts, I re-export some native classes like this:

export const BlufiClient = com.esp32.blufi.BlufiClient;
export const BlufiCallback = com.esp32.blufi.BlufiCallback;

and I have my typings for said classes in index.d.ts:

declare module '@freevse/nativescript-blufi'{
  export class BlufiClient{
        ctor, functions, etc...
  }

  export abstract class BlufiCallback {
        ctor, functions, etc...
  }
}

My issue is that when using the pack.sh script in the 'publish' folder, both of the class typings above become (the resulting index.d.ts file contains):

export declare const BlufiClient: any;
export declare const BlufiCallback: any;

All the typings I wrote are squashed by any...

The repo is available here

Any idea what's going on?

Matthew Goulart
  • 2,873
  • 4
  • 28
  • 63

1 Answers1

1

So it turned out

"compilerOptions": {
    "declaration": true,
}

was the issue. tsc was overwriting my handwritten typings with generated ones.

Matthew Goulart
  • 2,873
  • 4
  • 28
  • 63