enonic-types
Advanced tools
Comparing version 0.2.0-beta3 to 0.2.0
{ | ||
"name": "enonic-types", | ||
"sideEffects": false, | ||
"version": "0.2.0-beta3", | ||
"version": "0.2.0", | ||
"description": "TypeScript types for Enonic XP", | ||
@@ -6,0 +6,0 @@ "typings": "index.d.ts", |
@@ -9,3 +9,3 @@ # TypeScript types for Enonic XP | ||
To install *enonic-types* from npm, run the following command: | ||
Install *enonic-types* from npm by running: | ||
@@ -16,2 +16,16 @@ ```bash | ||
Add support to use typed `import` updating your *tsconfig.json* file with the `"types"` field: | ||
```json | ||
{ | ||
"compilerOptions": { | ||
... | ||
"types": ["node", "enonic-types"] | ||
} | ||
} | ||
``` | ||
And you're ready to start coding! | ||
## Code generation | ||
@@ -50,5 +64,5 @@ | ||
## Declare `__non_webpack_require__` | ||
## Using `__non_webpack_require__` | ||
Your project should have a *types.ts* file where you can specify declarations. | ||
If your project is using `__non_webpack_require__`, you should update your *types.ts* file to add type support to it. | ||
@@ -60,3 +74,3 @@ If you add (or replace the existing) | ||
```typescript | ||
type LibMap = import("enonic-types").EnonicLibraryMap; | ||
type LibMap = import("enonic-types/libs").EnonicLibraryMap; | ||
@@ -63,0 +77,0 @@ declare const __non_webpack_require__: <K extends keyof LibMap | string = string>(path: K) => K extends keyof LibMap |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
102613
111