Documentation Index
Fetch the complete documentation index at: https://cdktn.io/docs/llms.txt
Use this file to discover all available pages before exploring further.
Fragments of a concatenated string containing stringified Tokens.
Initializers
import { TokenizedStringFragments } from 'cdktn'
new TokenizedStringFragments()
Methods
| Name | Description |
|---|
addEscape | No description. |
addIntrinsic | Adds an intrinsic fragment. |
addLiteral | Adds a literal fragment. |
addToken | Adds a token fragment. |
concat | No description. |
join | Combine the string fragments using the given joiner. |
mapTokens | Apply a transformation function to all tokens in the string. |
addEscape
public addEscape(kind: string): void
kindRequired
addIntrinsic
public addIntrinsic(value: any): void
Adds an intrinsic fragment.
valueRequired
the intrinsic value to add.
addLiteral
public addLiteral(lit: any): void
Adds a literal fragment.
litRequired
the literal to add.
addToken
public addToken(token: IResolvable): void
Adds a token fragment.
tokenRequired
the token to add.
concat
public concat(other: TokenizedStringFragments): void
otherRequired
join
public join(concat: IFragmentConcatenator): any
Combine the string fragments using the given joiner.
If there are any
concatRequired
mapTokens
public mapTokens(context: IResolveContext): TokenizedStringFragments
Apply a transformation function to all tokens in the string.
contextRequired
Properties
| Name | Type | Description |
|---|
escapes | IResolvable[] | Return all escape fragments from this string. |
firstValue | any | Returns the first value. |
intrinsic | IResolvable[] | Return all intrinsic fragments from this string. |
length | number | Returns the number of fragments. |
literals | IResolvable[] | Return all literals from this string. |
tokens | IResolvable[] | Return all Tokens from this string. |
firstToken | IResolvable | Returns the first token. |
escapesRequired
public readonly escapes: IResolvable[];
Return all escape fragments from this string.
firstValueRequired
public readonly firstValue: any;
Returns the first value.
intrinsicRequired
public readonly intrinsic: IResolvable[];
Return all intrinsic fragments from this string.
lengthRequired
public readonly length: number;
Returns the number of fragments.
literalsRequired
public readonly literals: IResolvable[];
Return all literals from this string.
tokensRequired
public readonly tokens: IResolvable[];
Return all Tokens from this string.
firstTokenOptional
public readonly firstToken: IResolvable;
Returns the first token.