@kipper/target-ts
Table of contents
Classes
- KipperTypeScriptTarget
- TypeScriptTargetBuiltInGenerator
- TypeScriptTargetCodeGenerator
- TypeScriptTargetSemanticAnalyser
Variables
Functions
Variables
TargetTS
• Const
TargetTS: typeof KipperTypeScriptTarget
= KipperTypeScriptTarget
The TypeScript translation target for the Kipper language.
Alias for KipperTypeScriptTarget.
Since
0.10.0
Defined in
kipper/target-ts/src/target.ts:103
author
• Const
author: "Luna Klatzer"
Defined in
kipper/target-ts/src/index.ts:18
github
• Const
github: "https://github.com/Kipper-Lang/Kipper"
Defined in
kipper/target-ts/src/index.ts:22
license
• Const
license: "GPL-3.0-or-later"
Defined in
kipper/target-ts/src/index.ts:20
name
• Const
name: "\@kipper/target-ts"
Defined in
kipper/target-ts/src/index.ts:14
version
• Const
version: "0.11.0"
Defined in
kipper/target-ts/src/index.ts:16
Functions
createTSFunctionSignature
▸ createTSFunctionSignature(signature
, ignoreParams?
): string
Generates the TypeScript function signature, based on the signature metadata.
Since
0.10.0
Parameters
Name | Type | Default value | Description |
---|---|---|---|
signature |
Object |
undefined |
The function signature metadata. |
signature.identifier |
string |
undefined |
- |
signature.params |
{ identifier : string ; type : any }[] |
undefined |
- |
signature.returnType |
any |
undefined |
- |
ignoreParams |
boolean |
false |
Whether or not to ignore the parameters of the function. |
Returns
string
Defined in
kipper/target-ts/src/tools.ts:56
genTSFunction
▸ genTSFunction(signature
, body
, ignoreParams?
): TranslatedCodeLine
[]
Generates a TypeScript function from the given signature and body.
Since
0.10.0
Parameters
Name | Type | Default value | Description |
---|---|---|---|
signature |
Object |
undefined |
The signature of the function. |
signature.identifier |
string |
undefined |
- |
signature.params |
{ identifier : string ; type : any }[] |
undefined |
- |
signature.returnType |
any |
undefined |
- |
body |
string |
undefined |
The body of the function. |
ignoreParams |
boolean |
false |
Whether or not to ignore the parameters of the function. |
Returns
TranslatedCodeLine
[]
Defined in
kipper/target-ts/src/built-in-generator.ts:19
genTSVariable
▸ genTSVariable(varSpec
, value
): TranslatedCodeLine
Generates a JavaScript local or global variable from the given variable and value.
Parameters
Name | Type | Description |
---|---|---|
varSpec |
BuiltInVariable |
The variable to generate. |
value |
string |
The value of the variable. |
Returns
TranslatedCodeLine
Defined in
kipper/target-ts/src/built-in-generator.ts:47
getTSFunctionSignature
▸ getTSFunctionSignature(funcSpec
): Object
Generates the signature for the function based on the funcSpec, which can be used in an TypeScript env.
Since
0.10.0
Parameters
Name | Type | Description |
---|---|---|
funcSpec |
any |
The function spec object containing the metadata of the function. |
Returns
Object
Name | Type |
---|---|
identifier |
string |
params |
{ identifier : string ; type : KipperCompilableType | KipperCompilableType [] }[] |
returnType |
KipperCompilableType | KipperCompilableType [] |
Defined in
kipper/target-ts/src/tools.ts:20