See <ComponentProps>
A portion of the configuration object to pass to the FuseComponent
constructor.
type FuseComponentPropsV1 = {
isFinished?: boolean | undefined;
isLit?: boolean | undefined;
currentFuseAmount?: number | undefined;
};
type FuseComponentProps = FuseComponentPropsV1;
isFinished
(optional, defaultfalse
)<boolean>
isLit
(optional, defaultfalse
)<boolean>
currentFuseAmount
(optional, default1
)<number>
Creates a versioned Fuse
component.
props
<ComponentProps & FuseComponentProps>
Configuration of the component to create.- Returns:
<FuseComponent>
import { FuseComponent } from 'att-string-transcoder';
const componentVersion = 1;
const component = new FuseComponent({ version: componentVersion });
See Component.fromBinary(reader, version)
Note that the following properties are sorted in order of appearance when decoding component binary data.
See Component.hash
See Component.name
Whether the fuse is finished or not.
- Since:
v1
<boolean>
import { FuseComponent } from 'att-string-transcoder';
const componentVersion = 1;
const component = new FuseComponent({ version: componentVersion });
const isFinished = component.isFinished;
// `isFinished` is `false`
Whether the fuse is lit or not.
- Since:
v1
<boolean>
import { FuseComponent } from 'att-string-transcoder';
const componentVersion = 1;
const component = new FuseComponent({ version: componentVersion });
const isLit = component.isLit;
// `isLit` is `false`
How much of the fuse is left.
- Since:
v1
<number>
A number between0
and1
(inclusive).
import { FuseComponent } from 'att-string-transcoder';
const componentVersion = 1;
const component = new FuseComponent({ version: componentVersion });
const currentFuseAmount = component.currentFuseAmount;
// `currentFuseAmount` is `1`
See Component.toBinary(version?)