-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
ExternalRelates to another program, environment, or user action which we cannot control.Relates to another program, environment, or user action which we cannot control.
Description
TypeScript Version: 2.0.3
Code
Install office-js
types definition:
npm install --save-dev @types/office-js
Try to use the Office
object in app.ts
:
import {Office} from 'office-js'; // [ts] File 'node_modules/@types/office-js/index.d.ts' is not a module.
export class App {
constructor() {
let doc = Office.context.document;
}
}
TypeScript configuration in tsconfig.json
:
{
"compilerOptions": {
"target": "es5",
"module": "amd",
"moduleResolution": "node",
"lib": ["es2015", "dom"],
"typeRoots": [
"node_modules/@types"
]
}
}
Expected behavior:
TypeScript 2.0 should use the types definitions that are available from npm @types
.
Actual behavior:
TypeScript reports error: File 'node_modules/@types/office-js/index.d.ts' is not a module.
TypeScript does not recognize the Office
as valid object and does not provide intellisense.
slissner, balazsnemeth, romko391, devYonz and brandonaaskov
Metadata
Metadata
Assignees
Labels
ExternalRelates to another program, environment, or user action which we cannot control.Relates to another program, environment, or user action which we cannot control.