.d.ts Questions
2
Solved
I have a test project in which I'm testing type definition files. The project has one file called index.ts which looks like this:
import i18nFu = require("gettext.js");
The gettext.js pa...
Templetempler asked 16/4, 2020 at 19:52
2
Solved
So maybe I'm confused, but I thought that if I added declaration:true to my tsconfig.json I could have it tsc copy my *.d.ts files, along side the transpiled code & it's d.ts files?
EG:
- src...
Enrollee asked 7/5, 2019 at 8:8
1
Solved
I have an internal package with about the following structure:
myPackage/
|- types/
| |- type1.d.ts
| |- type2.d.ts
|- src/
| |- someUtilities.ts
|- index.ts
|- package.json
|- tsconfig.json
The i...
Expansible asked 20/1, 2023 at 11:58
3
Solved
Let's say I have these types:
type BaseAnimal = {
species: string
owner: boolean
}
type Cat = BaseAnimal & {
species: 'cat'
hasTail: boolean
}
type Dog = BaseAnimal & {
species: 'dog...
Erythrocytometer asked 16/7, 2020 at 6:10
1
In Three.js there is a field on Object3D class called userData, which in the type declaration file node_modules/three/src/core/Object3D.d.ts is defined as
/**
* Base class for scene graph objects
...
Winonawinonah asked 25/1, 2021 at 11:58
4
In the Typescript definition file (DefinitelyTyped) I am examining, there is an interface, a function and a namespace all with the exact same name: twilio.
Here is the sample, from the first few li...
Orton asked 18/1, 2018 at 5:44
3
I have created a project using create react app typescript. I have a few d.ts files where I have defined interfaces types and enums. When I run start script. It is not able to load the d.ts files. ...
Bilyeu asked 1/3, 2019 at 17:50
3
I'm new to Vue and I would like to learn how to create components and publish the package to NPM. So, my idea is to create Vue (typescript) + Vuetify reusable components and install them from NPM i...
Ancalin asked 18/9, 2019 at 17:37
1
Very trivial problem it seems. I have a rollup typescript config using rollup-plugin-typescript and rollup-plugin-dts. I want to bundle all my d.ts files into one d.ts file instead of having it mir...
Bourgeon asked 25/8, 2021 at 12:2
1
From typescript-eslint docs:
Custom TypeScript modules (module foo {}) and namespaces (namespace foo {}) are considered outdated ways to organize TypeScript code. ES2015 module syntax is now prefe...
Streamlet asked 24/9, 2020 at 9:27
2
Solved
There are many resources explaining a declaration file (d.ts) is useful for either:
Declaring types for JS libraries used in your TS project, or
Allowing your JS library to be consumed by other TS...
Fanny asked 11/8, 2021 at 19:7
3
Let's say I have a JavaScript class
/**
* @element my-element
*/
export class MyElement extends HTMLElement {
publicMethod() {}
/** @private */
privateMethod() {}
}
customElements.define('m...
Barby asked 27/1, 2020 at 6:24
1
Solved
Is there a way to declare a different module name for a generated .d.ts file?
tsc generates declare module "index" { instead of declare module "@myorg/my-pkg" (which would match the name attribute...
Sundstrom asked 17/10, 2019 at 20:18
1
Solved
As a bit of a fun project, I'm making a "framework" for creating native web components. I've created a webpack loader that parses some XML in custom .comp files and exports an es2015 class. Unfortu...
Patio asked 28/9, 2019 at 20:9
3
Solved
Project Info
I'm working on a JavaScript project that utilizes .d.ts files. This is a subsequent question to a question I previously asked, so you can view more information regarding the project h...
Cranford asked 27/6, 2018 at 10:16
2
Solved
I need to write a .d.ts file for an external (npm) library. I am using typescript 3.
The imports I need are:
import fakedb from 'fake-indexeddb'; //sorted
// second import I would like:
import d...
Apportionment asked 1/4, 2019 at 8:11
3
Solved
Problem
I am working on JavaScript project using VSCode. I am using the UMD design pattern and vscode intellisense cannot recognize the exports of a module from another file. I added all the decla...
Solace asked 11/10, 2017 at 2:9
2
Solved
In many TypeScript examples files of the *.d.ts type are automatically created at build time. Some of the examples speak of ambient declarations. This though doesn't help me understanding the idea ...
Apo asked 22/5, 2018 at 9:15
2
Solved
I'm writing a TypeScript definition file for an existing node library which use building node module like http and events.EventEmitter as a parameter.
my question is how can I write a definition fi...
Eelworm asked 23/3, 2016 at 15:33
1
© 2022 - 2024 — McMap. All rights reserved.