• Kipper

    v0.12.1
  • Downloads

  • Docs

  • Playground

  • Changelog

  • Kipper

    v0.12.1
    • Downloads

    • Docs

    • Playground

    • Changelog

      • latest /
      • Kipper API /
      • Module /
      • @kipper/target-ts /
      • index
    Kipper Docs
    • next
    • latest
    • 0.11.0
    • 0.10.4
    • 0.9.2
    • Overview

    • Quickstart

    • Goals for Kipper

    • Supported platforms

    • Usage Examples

      • Overview

      • Type Consistency

      • Runtime Type Casting

      • Strict Compiler Inspection

      • Integrated Runtime Library

    • Variables

      • Overview

      • String Type

      • Number Type

      • Boolean Type

      • Void Type

      • Null Type

      • Undefined Type

      • Array Type

      • Overview

      • Tangled Expression

      • Arithmetic Expression

      • Assignment Expression

      • Conditional Expressions

      • Logical Expressions

      • Bitwise Expression

      • Relational Expressions

      • Convert Or Cast Expression

      • F-String Expression

      • Member Access Expression

      • Function Call Expression

      • Lambda Expression

      • Matches Expression

      • Overview

      • Expression Statement

      • If Statement

      • While Loop

      • Do-While Loop

      • For Loop

      • Compound Statement

      • Jump Statement

    • Functions

    • Interfaces

    • Classes

    • Comments

    • Built-in Functions

      • Overview

      • Compiler Setup

        • Overview

          • index

          • compiler

          • errors

          • logger

          • utils

          • config

          • index

          • index

        • Overview

        • new

        • run

        • compile

        • help

        • version

      • latest /
      • Kipper API /
      • Module /
      • @kipper/target-ts /
      • index
    • latest /
    • Kipper API /
    • Module /
    • @kipper/target-ts /
    • index

    Edit page

    @kipper/target-ts

    Table of contents

    Classes

    • KipperTypeScriptTarget
    • TypeScriptTargetBuiltInGenerator
    • TypeScriptTargetCodeGenerator
    • TypeScriptTargetSemanticAnalyser

    Variables

    • TargetTS
    • author
    • github
    • license
    • name
    • version

    Functions

    • createTSFunctionSignature
    • createTSGenericFunctionSignature
    • genTSFunction
    • genTSGenericFunction
    • genTSVariable
    • getTSFunctionSignature

    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:108


    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.12.1"

    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: ProcessedType }[] undefined -
    signature.returnType ProcessedType undefined -
    ignoreParams boolean false Whether or not to ignore the parameters of the function.

    Returns

    string

    Defined in

    kipper/target-ts/src/tools.ts:59


    createTSGenericFunctionSignature

    ▸ createTSGenericFunctionSignature(signature, ignoreParams?): string

    Parameters

    Name Type Default value
    signature Object undefined
    signature.identifier string undefined
    signature.params { identifier: string ; type: any }[] undefined
    signature.returnType any undefined
    ignoreParams boolean false

    Returns

    string

    Defined in

    kipper/target-ts/src/tools.ts:75


    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: ProcessedType }[] undefined -
    signature.returnType ProcessedType 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:25


    genTSGenericFunction

    ▸ genTSGenericFunction(signature, body, ignoreParams?): TranslatedCodeLine[]

    Generates a TypeScript generic function from the given signature and body.

    This allows for the use of 'T' as a generic type in the function. This is just a very primitive function which is used to avoid TS errors when using type unions or similar. Will probably be improved in the future as the type system gets more complex.

    Since

    0.12.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.</td>

    Returns

    TranslatedCodeLine[]

    Defined in

    kipper/target-ts/src/built-in-generator.ts:48


    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:65


    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: ProcessedType }[]
    returnType ProcessedType

    Defined in

    kipper/target-ts/src/tools.ts:20

  • Developed at:

    • Releases
    • GitHub
    • Security
    • Issue Tracker
    • License
  • Copyright © 2021-2025 Luna Klatzer, 2024-2025 Lorenz Holzbauer & Fabian Baitura.
    Kipper is licensed under the GPL-3.0-or-later license.