Ayfri
02/08/2022, 10:59 AMandylamax
02/08/2022, 3:48 PMBig Chungus
02/08/2022, 3:50 PMRecord<T>
type for example. This then can be used in your public API that you plan to export to your TS consumers.Grégory Lureau
02/08/2022, 4:12 PMBig Chungus
02/08/2022, 4:16 PMGrégory Lureau
02/08/2022, 4:21 PMturansky
02/08/2022, 4:28 PM1 kt -> n js
1. Converter - from TS to Kotlin
cc @Sergei GrishchenkoBig Chungus
02/08/2022, 4:42 PMturansky
02/08/2022, 4:42 PMRecord
located in kotlin-extensions
Sergei Grishchenko
02/08/2022, 4:52 PMTo get "global"Please, don't use such generic types fromtype for example. TRecord<T>
kotlin-typescript
, it is internal declarations for typescript compiler, these types are needed for infrastructure tasks (static code analysis, code transformations, etc.)
For kotlin js stdlib polifiling kotlin-extensions
module should be used.Big Chungus
02/08/2022, 5:00 PMBig Chungus
02/08/2022, 5:03 PMturansky
02/08/2022, 5:37 PMkotlin-typescript
- TypeScript compiler declarations (for Node.js only)turansky
02/08/2022, 5:38 PMRecord
from kotlin-extensions
will be used in futureBig Chungus
02/08/2022, 5:40 PMBig Chungus
02/08/2022, 5:41 PMcompiler
is the key word here. i.e. it has nothing to do with ts utility types like Record.
I'm not at a loss trying to come up with a use case for having such kotlin wrappers.turansky
02/08/2022, 5:44 PMAyfri
02/08/2022, 5:44 PMRecord
in kotlin-extensions
isn't right, as an object in JS can have nullable keys & valuesturansky
02/08/2022, 5:51 PMBig Chungus
02/08/2022, 5:52 PMturansky
02/08/2022, 5:54 PMArray
? 🙂Ayfri
02/08/2022, 5:54 PMSergei Grishchenko
02/08/2022, 7:58 PMAm I missing something obvious?@Big Chungus it seems you mix up internal ts declarations https://github.com/microsoft/TypeScript/blob/main/lib/typescript.d.ts and external (there is external declaration for each release of ECMAScript e. g. https://github.com/microsoft/TypeScript/blob/main/lib/lib.es2015.d.ts) Yea, you are right, there is no stdlib in typescript but typescript has declaration for all browser environment that specified in ECMAScript and you can cofigure what environment your code is executed in, see lib tsconfig option https://www.typescriptlang.org/tsconfig#lib Kotlin has similar staff but unfortunately Kotlin definitions are outdated often, and you cannot configure your environment, that is why we have kotlin-extentions in wrappers
Sergei Grishchenko
02/08/2022, 8:25 PMRecord
or Omit
also are declared here https://github.com/microsoft/TypeScript/blob/08221166d9c383ee6c6cc82ad1869a9847f7051e/src/lib/es5.d.ts