@kismet.ts/shared / Exports

@kismet.ts/shared

Table of contents

Namespaces

Classes

Interfaces

Type Aliases

Variables

Functions

Type Aliases

ArrayUnion

Ƭ ArrayUnion<T>: T | T[]

Type parameters

Name
T

Defined in

util/types.ts:1open in new window


Awaitable

Ƭ Awaitable<T>: Promise<T> | T

Type parameters

NameType
Tvoid

Defined in

util/types.ts:3open in new window


ClassConstructor

Ƭ ClassConstructor<T, U>: (...args: U) => T

Type parameters

NameType
Tunknown
Uextends unknown[] = []

Type declaration

• (...args)

Parameters
NameType
...argsU

Defined in

util/types.ts:5open in new window


DeprecateFunction

Ƭ DeprecateFunction: (fn: Function, msg: string, code?: string) => void

Type declaration

▸ (fn, msg, code?): void

Parameters
NameType
fnFunction
msgstring
code?string
Returns

void

Defined in

debug/deprecate.ts:1open in new window


Enum

Ƭ Enum<T>: T | `${T}`

Type parameters

NameType
Textends string

Defined in

util/types.ts:9open in new window


If

Ƭ If<T, U, P>: T extends true ? U : P

Type parameters

NameType
Textends boolean
UU
Pundefined

Defined in

util/types.ts:11open in new window


KismetFormatterInput

Ƭ KismetFormatterInput: string | number | boolean | null | undefined

Defined in

kismet/functions.ts:4open in new window


LogHandlerReturnType

Ƭ LogHandlerReturnType: "completed" | "error" | "log"

Defined in

debug/logger.ts:1open in new window


LogHandlerStream

Ƭ LogHandlerStream: "stdout" | "stderr" | "http"

Defined in

debug/logger.ts:6open in new window


MessageKey

Ƭ MessageKey: keyof typeof Messages

Defined in

error/Messages.ts:27open in new window


MessageParams

Ƭ MessageParams<T>: typeof Messages[T] extends (...args: any[]) => any ? Parameters<typeof Messages[T]> : []

Type parameters

NameType
Textends MessageKey

Defined in

error/Messages.ts:29open in new window


RemoteKismetAssetType

Ƭ RemoteKismetAssetType: "classes" | "nodes" | "blender" | "itemdb"

Defined in

remote/nodes.ts:1open in new window

Variables

typeguards

Const typeguards: Object

Type declaration

NameType
isBoolean(t: unknown) => t is boolean
isString(t: unknown) => t is string

Defined in

util/util.ts:174open in new window

Functions

arrayUnionInput

arrayUnionInput<T>(input): T[]

Type parameters

Name
T

Parameters

NameType
inputArrayUnion<T>

Returns

T[]

Defined in

util/util.ts:4open in new window


browserDeprecate

browserDeprecate(...args): () => any

Parameters

NameType
...args[fn: Function, msg: string, code?: string]

Returns

fn

▸ (): any

Returns

any

Defined in

debug/deprecate.ts:3open in new window


capitalize

capitalize(input?): string | null

Parameters

NameType
input?string

Returns

string | null

Defined in

util/util.ts:128open in new window


cast

cast<T>(input, type?): T

Type parameters

Name
T

Parameters

NameType
inputunknown
type?"number" | "boolean"

Returns

T

Defined in

util/util.ts:133open in new window


constructItem

constructItem<R, T>(item): R

Type parameters

NameType
Rextends A<R>
Textends typeof A

Parameters

NameType
itemT

Returns

R

Defined in

kismet/functions.ts:116open in new window


convertVariablesRecordToArray

convertVariablesRecordToArray<T>(variables): [string, T][]

Type parameters

NameType
Tundefined

Parameters

NameType
variablesRecord<string, T>

Returns

[string, T][]

Defined in

kismet/functions.ts:72open in new window


destructureDefaultProperty

destructureDefaultProperty(input): undefined | [string, string][]

Parameters

NameType
inputstring

Returns

undefined | [string, string][]

Defined in

kismet/destructure.ts:1open in new window


destructureProperty

destructureProperty(rawInput): [string, string]

Parameters

NameType
rawInputstring

Returns

[string, string]

Defined in

kismet/destructure.ts:18open in new window


filterEmptyLines

filterEmptyLines(input): string

Parameters

NameType
inputstring | string[]

Returns

string

Defined in

util/util.ts:8open in new window


filterMultipleEmptyLines

filterMultipleEmptyLines(content): string

Parameters

NameType
contentstring

Returns

string

Defined in

util/util.ts:17open in new window


getNodeType

getNodeType(Class): NodeType | undefined

Get the node type for a given item class

Parameters

NameTypeDescription
ClassstringThe input class of the item

Returns

NodeType | undefined

The node type. Sequences are not included

Defined in

kismet/functions.ts:85open in new window


groupByProperty

groupByProperty<T>(input, propertyName): T[][]

Type parameters

NameType
Textends Record<string, unknown>

Parameters

NameType
inputT[]
propertyNamekeyof T

Returns

T[][]

Defined in

util/util.ts:25open in new window


indent

indent(repeat?): string

Create an indent with 4 spaces

Parameters

NameTypeDefault valueDescription
repeat?number1The amount of indents

Returns

string

Defined in

util/util.ts:116open in new window


isType

isType(type, input, keys?): boolean

Parameters

NameType
typeobjectType
inputunknown
keys?string[]

Returns

boolean

Defined in

util/util.ts:61open in new window


mapObjectKeys

mapObjectKeys<T, C>(object, fn): C[][]

Map over the keys of an object.

Can be seen as object[string].map(fn)

Type parameters

Name
T
C

Parameters

NameType
objectRecord<string, T[]>
fn(obj: T, i: number, array: T[]) => C

Returns

C[][]

Defined in

util/util.ts:103open in new window


pick

pick<T, K>(obj, keys): Pick<T, K[number]>

Type parameters

NameType
Textends Record<string, unknown>
Kextends keyof T[]

Parameters

NameType
objT
keysK

Returns

Pick<T, K[number]>

Defined in

util/util.ts:149open in new window


pickExclude

pickExclude<T, K>(obj, keys): Pick<T, Exclude<keyof T, K[number]>>

Type parameters

NameType
Textends Record<string, unknown>
Kextends keyof T[]

Parameters

NameType
objT
keysK

Returns

Pick<T, Exclude<keyof T, K[number]>>

Defined in

util/util.ts:163open in new window


quote

quote(value): string

Surround the value with " quotes

Parameters

NameType
valuestring

Returns

string

Defined in

util/util.ts:124open in new window


readArchetype

readArchetype(archetype): Record<"Class" | "ClassType" | "Package", string>

Get the class, class type and package name from an archetype

Parameters

NameTypeDescription
archetypestringThe archetype of the item

Returns

Record<"Class" | "ClassType" | "Package", string>

Defined in

kismet/functions.ts:124open in new window