This repository was archived by the owner on Oct 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 886
This repository was archived by the owner on Oct 4, 2024. It is now read-only.
Distribute Typescript type file(s, *.d.ts) to allow type-safe use from Typescript #366
Copy link
Copy link
Open
Description
TS has support for generating *.d.ts for js by flags(allowJs and declarations) in version 3.7, however it fails when applied to both the distributed firepad 1.5.10 as well as the latest sources.
Version info
Firepad: 1.5.10
Test case
tsc --allowJs --declaration --emitDeclarationOnly ./node_modules/firepad/dist/firepad.js
Expected behavior
valid firepad.d.ts created next to firepad.js
Actual behavior
node_modules/firepad/dist/firepad.js:14:1 - error TS9005: Declaration emit for this file requires using private name 'Entity'. An explicit type annotation may unblock declaration emit.
14 (function (name, definition, context) {
~
node_modules/firepad/dist/firepad.js:14:1 - error TS9005: Declaration emit for this file requires using private name 'Firepad'. An explicit type annotation may unblock declaration emit.
14 (function (name, definition, context) {
~
node_modules/firepad/dist/firepad.js:14:1 - error TS9005: Declaration emit for this file requires using private name 'Headless'. An explicit type annotation may unblock declaration emit.
14 (function (name, definition, context) {
~
node_modules/firepad/dist/firepad.js:14:1 - error TS9005: Declaration emit for this file requires using private name 'MonacoAdapter'. An explicit type annotation may unblock declaration emit.
14 (function (name, definition, context) {
~
node_modules/firepad/dist/firepad.js:14:1 - error TS9005: Declaration emit for this file requires using private name 'RichTextCodeMirrorAdapter'. An explicit type annotation may unblock declaration emit.
14 (function (name, definition, context) {
~
node_modules/firepad/dist/firepad.js:14:1 - error TS9005: Declaration emit for this file requires using private name 'TextOperation'. An explicit type annotation may unblock declaration emit.
14 (function (name, definition, context) {
~
Found 6 errors.
Test case
- git clone https://github.com/FirebaseExtended/firepad.git
- tsc --init
- tsc --allowJs --declaration --emitDeclarationOnly -p .
Actual behavior
examples/firepad-userlist.js:1:1 - error TS9005: Declaration emit for this file requires using private name 'FirepadUserList'. An explicit type annotation may unblock declaration emit.
1 var FirepadUserList = (function() {
~~~
lib/monaco-adapter.js:1:1 - error TS9005: Declaration emit for this file requires using private name 'MonacoAdapter'. An explicit type annotation may unblock declaration emit.
1 'use strict';
~~~~~~~~~~~~
Found 2 errors.
Metadata
Metadata
Assignees
Labels
No labels