@kismet.ts/shared / Exports
@kismet.ts/shared
Table of contents
Namespaces
Classes
Interfaces
Type Aliases
- ArrayUnion
- Awaitable
- ClassConstructor
- DeprecateFunction
- Enum
- If
- KismetFormatterInput
- LogHandlerReturnType
- LogHandlerStream
- MessageKey
- MessageParams
- RemoteKismetAssetType
Variables
Functions
- arrayUnionInput
- browserDeprecate
- capitalize
- cast
- constructItem
- convertVariablesRecordToArray
- destructureDefaultProperty
- destructureProperty
- filterEmptyLines
- filterMultipleEmptyLines
- getNodeType
- groupByProperty
- indent
- isType
- mapObjectKeys
- pick
- pickExclude
- quote
- readArchetype
Type Aliases
ArrayUnion
Ƭ ArrayUnion<T
>: T
| T
[]
Type parameters
Name |
---|
T |
Defined in
Awaitable
Ƭ Awaitable<T
>: Promise
<T
> | T
Type parameters
Name | Type |
---|---|
T | void |
Defined in
ClassConstructor
Ƭ ClassConstructor<T
, U
>: (...args
: U
) => T
Type parameters
Name | Type |
---|---|
T | unknown |
U | extends unknown [] = [] |
Type declaration
• (...args
)
Parameters
Name | Type |
---|---|
...args | U |
Defined in
DeprecateFunction
Ƭ DeprecateFunction: (fn
: Function
, msg
: string
, code?
: string
) => void
Type declaration
▸ (fn
, msg
, code?
): void
Parameters
Name | Type |
---|---|
fn | Function |
msg | string |
code? | string |
Returns
void
Defined in
Enum
Ƭ Enum<T
>: T
| `${T}`
Type parameters
Name | Type |
---|---|
T | extends string |
Defined in
If
Ƭ If<T
, U
, P
>: T
extends true
? U
: P
Type parameters
Name | Type |
---|---|
T | extends boolean |
U | U |
P | undefined |
Defined in
KismetFormatterInput
Ƭ KismetFormatterInput: string
| number
| boolean
| null
| undefined
Defined in
LogHandlerReturnType
Ƭ LogHandlerReturnType: "completed"
| "error"
| "log"
Defined in
LogHandlerStream
Ƭ LogHandlerStream: "stdout"
| "stderr"
| "http"
Defined in
MessageKey
Ƭ MessageKey: keyof typeof Messages
Defined in
MessageParams
Ƭ MessageParams<T
>: typeof Messages
[T
] extends (...args
: any
[]) => any
? Parameters
<typeof Messages
[T
]> : []
Type parameters
Name | Type |
---|---|
T | extends MessageKey |
Defined in
RemoteKismetAssetType
Ƭ RemoteKismetAssetType: "classes"
| "nodes"
| "blender"
| "itemdb"
Defined in
Variables
typeguards
• Const
typeguards: Object
Type declaration
Name | Type |
---|---|
isBoolean | (t : unknown ) => t is boolean |
isString | (t : unknown ) => t is string |
Defined in
Functions
arrayUnionInput
▸ arrayUnionInput<T
>(input
): T
[]
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
input | ArrayUnion <T > |
Returns
T
[]
Defined in
browserDeprecate
▸ browserDeprecate(...args
): () => any
Parameters
Name | Type |
---|---|
...args | [fn: Function, msg: string, code?: string] |
Returns
fn
▸ (): any
Returns
any
Defined in
capitalize
▸ capitalize(input?
): string
| null
Parameters
Name | Type |
---|---|
input? | string |
Returns
string
| null
Defined in
cast
▸ cast<T
>(input
, type?
): T
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
input | unknown |
type? | "number" | "boolean" |
Returns
T
Defined in
constructItem
▸ constructItem<R
, T
>(item
): R
Type parameters
Name | Type |
---|---|
R | extends A <R > |
T | extends typeof A |
Parameters
Name | Type |
---|---|
item | T |
Returns
R
Defined in
convertVariablesRecordToArray
▸ convertVariablesRecordToArray<T
>(variables
): [string
, T
][]
Type parameters
Name | Type |
---|---|
T | undefined |
Parameters
Name | Type |
---|---|
variables | Record <string , T > |
Returns
[string
, T
][]
Defined in
destructureDefaultProperty
▸ destructureDefaultProperty(input
): undefined
| [string
, string
][]
Parameters
Name | Type |
---|---|
input | string |
Returns
undefined
| [string
, string
][]
Defined in
destructureProperty
▸ destructureProperty(rawInput
): [string
, string
]
Parameters
Name | Type |
---|---|
rawInput | string |
Returns
[string
, string
]
Defined in
filterEmptyLines
▸ filterEmptyLines(input
): string
Parameters
Name | Type |
---|---|
input | string | string [] |
Returns
string
Defined in
filterMultipleEmptyLines
▸ filterMultipleEmptyLines(content
): string
Parameters
Name | Type |
---|---|
content | string |
Returns
string
Defined in
getNodeType
▸ getNodeType(Class
): NodeType
| undefined
Get the node type for a given item class
Parameters
Name | Type | Description |
---|---|---|
Class | string | The input class of the item |
Returns
NodeType
| undefined
The node type. Sequences are not included
Defined in
groupByProperty
▸ groupByProperty<T
>(input
, propertyName
): T
[][]
Type parameters
Name | Type |
---|---|
T | extends Record <string , unknown > |
Parameters
Name | Type |
---|---|
input | T [] |
propertyName | keyof T |
Returns
T
[][]
Defined in
indent
▸ indent(repeat?
): string
Create an indent with 4 spaces
Parameters
Name | Type | Default value | Description |
---|---|---|---|
repeat? | number | 1 | The amount of indents |
Returns
string
Defined in
isType
▸ isType(type
, input
, keys?
): boolean
Parameters
Name | Type |
---|---|
type | objectType |
input | unknown |
keys? | string [] |
Returns
boolean
Defined in
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
Name | Type |
---|---|
object | Record <string , T []> |
fn | (obj : T , i : number , array : T []) => C |
Returns
C
[][]
Defined in
pick
▸ pick<T
, K
>(obj
, keys
): Pick
<T
, K
[number
]>
Type parameters
Name | Type |
---|---|
T | extends Record <string , unknown > |
K | extends keyof T [] |
Parameters
Name | Type |
---|---|
obj | T |
keys | K |
Returns
Pick
<T
, K
[number
]>
Defined in
pickExclude
▸ pickExclude<T
, K
>(obj
, keys
): Pick
<T
, Exclude
<keyof T
, K
[number
]>>
Type parameters
Name | Type |
---|---|
T | extends Record <string , unknown > |
K | extends keyof T [] |
Parameters
Name | Type |
---|---|
obj | T |
keys | K |
Returns
Pick
<T
, Exclude
<keyof T
, K
[number
]>>
Defined in
quote
▸ quote(value
): string
Surround the value with " quotes
Parameters
Name | Type |
---|---|
value | string |
Returns
string
Defined in
readArchetype
▸ readArchetype(archetype
): Record
<"Class"
| "ClassType"
| "Package"
, string
>
Get the class, class type and package name from an archetype
Parameters
Name | Type | Description |
---|---|---|
archetype | string | The archetype of the item |
Returns
Record
<"Class"
| "ClassType"
| "Package"
, string
>