mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-08-28 22:08:54 -04:00
Allow paper core import in TypeScript (#1716)
* Allow paper core import in TypeScript Typings were missing when importing paper core version with: `import * as paper from 'paper/dist/paper-core'` syntax. This changes the generated TypeScript definition so that it exports two modules: `paper` and `paper/dist/paper-core`. In the same logic, `paper-core.d.ts` file is added to make sure that the corresponding definition is automatically loaded. This also takes care of the fact that `PaperScript` class is not available in paper core version, by removing it from the corresponding TypeScript definition. Finally, this also simplifies existing definition by directly exporting a `PaperScope` instance as the module instead of duplicating all `PaperScope` properties and methods on the module itself. Closes #1713
This commit is contained in:
parent
f0b8799c95
commit
43bbb249ab
4 changed files with 16 additions and 28 deletions
|
@ -23,6 +23,7 @@ gulp.task('zip', ['clean:zip', 'dist'], function() {
|
|||
'dist/paper-full*.js',
|
||||
'dist/paper-core*.js',
|
||||
'dist/paper.d.ts',
|
||||
'dist/paper-core.d.ts',
|
||||
'dist/node/**/*',
|
||||
'LICENSE.txt',
|
||||
'examples/**/*',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue