lightdm-webkit2-typescript
v2.0.6
Published
Typescript definitions for the lightdm-webkit2 javascript API
Downloads
3
Maintainers
Readme
Typescript definitions for lightdm-webkit2
This package delivers typescript definitions for lightdm-webkit2's javascript API. The intention is to make developing themes for lightdm-webkit2 a breeze with included type specifications and helpers with linting. This package does not include any other definitions than those given by the lightdm-webkit2 library, hence if you want jquery (@types/jquery
), moment.js(@types/moment
) or Cookie(@types/js-cookie
), you have to include those type-definitions yourself.
Installation
Use npm install --save-dev lightdm-webkit2-typescript
to install this definition as a dev dependency, and then define a tsconfig.json
according to Typescriptlang.org.
One example for a tsconfig.json
that will work well for lightdm-webkit2 developing is:
{
"compilerOptions": {
"target": "ES5",
"lib": [
"DOM",
"ES2015",
"ES2016",
"ES2017",
"ES2015.Iterable"
],
"typeRoots": [
"./node_modules/@types",
"./node_modules/lightdm-webkit2-typescript"
],
"outFile": "./greeter.js"
},
"include": [
"./**/*.ts"
],
"exclude": [
"node_modules",
"**/*.spec.ts"
]
}
In the config above the important part to notice is typeRoots
, which has to be defined with the path to this node module.
typeRoots
defines the files that will compiled as.d.ts
-library files.outFile
defines the file that will be the result of the typescript-compilation.include
defines the files that will be compiled to the results (currently a glob which specifies all .ts files in project directory)