I have installed a .d.ts file (namely, type definitions for p2.js library) as external (non-global) typings module with the following command:  typings install p2=github:schteppe/p2.js/index.d.ts#9d56924   I then use it in my TypeScript code like thi...
I have an external JS library with a global parameter:  function Thing() {  ...  } ... var thing = new Thing();   There is a TypeScript definition file, so in thing.d.ts:  declare var thing: ThingStatic; export default thing;  export interface ThingS...
I want to insert duplicate values into array based on length provided like this:  var a = [{displayName: 'bar'}, {displayName:'google'}, {displayName:'mod'}];; var dataTypesLength= 4;   Output should be like:  var a = [{displa...
Is there a way to change the type of interface property defined in a *.d.ts in typescript?  for example: An interface in x.d.ts is defined as    interface A {   property: number; }   I want to change it in the typescript files that I write to   inter...
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 declarations in a file called globals.d.ts. Unfortunately...
For a long time we've been having a problem that the only way to access a nested property safely and easily is to use _.get. Ex:  _.get(obj, "Some.Nested[2].Property", defaultValue);   This works great, but doesn't stand up to propert...
Input JSON:   {   "some_field":"some value" }   Type to be used for mapping:  export inteface SomeType {   someField:string; }   How can the mapping between JSON and TypeScript type be configured so that some_field -> someField?...
Why even in strict mode TypeScript is not complaining about this    function test(firstName: string, lastName?: string): string {     return firstName + " " + lastName; }  test('John');     Nor about this    const str: string = '&...
Since I am using webresource in my CRM functionality I need to use   window.parent.Xrm.Page...etc    to access entity data.   Unfortunately, as I write in typescript, this construction won't compile. For now I just add window.parent before Xrm.Pa...
I am creating a simple task demo and making the taskNameInput component. You can see a couple ways I've tried to approach this, but I keep getting errors. How to  for React with Typescript?  You can see my repo for my tsconfig.json and tslint.jso...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.