Skip to content

Latest commit

 

History

History
155 lines (99 loc) · 3.36 KB

HeatSourceBaseComponent.md

File metadata and controls

155 lines (99 loc) · 3.36 KB

Class: HeatSourceBaseComponent

Types

<ComponentProps>

See <ComponentProps>


<HeatSourceBaseComponentProps>

A portion of the configuration object to pass to the HeatSourceBaseComponent constructor.

type HeatSourceBaseComponentPropsV1 = {
  isLit?: boolean | undefined;
  progress?: number | undefined;
  time?: number | undefined;
};

export type HeatSourceBaseComponentProps = HeatSourceBaseComponentPropsV1;

Since v1

  • isLit (optional, default true) <boolean>
  • progress (optional, default 0) <number>
  • time (optional, default 31557600000000000) <number>

Constructors

new HeatSourceBaseComponent(props)

Creates a versioned HeatSourceBase component.

import { HeatSourceBaseComponent } from 'att-string-transcoder';

const componentVersion = 1;
const component = new HeatSourceBaseComponent({ version: componentVersion });

HeatSourceBaseComponent.fromBinary(reader, version)

See Component.fromBinary(reader, version)

Properties

Note that the following properties are sorted in order of appearance when decoding component binary data.

hash

See Component.hash


name

See Component.name


version

See Component.version


isLit

Whether this heat source is lit and active or not.

  • Since: v1
  • <boolean>
import { HeatSourceBaseComponent } from 'att-string-transcoder';

const componentVersion = 1;
const component = new HeatSourceBaseComponent({ version: componentVersion });

const isLit = component.isLit;
// `isLit` is `true`

progress

Progress of the heat source until extinguishing.

  • Since: v1
  • <number> A number between 0 and 1 (inclusive).
import { HeatSourceBaseComponent } from 'att-string-transcoder';

const componentVersion = 1;
const component = new HeatSourceBaseComponent({ version: componentVersion });

const progress = component.progress;
// `progress` is `0`

time

  • Since: v1
  • <number>
import { HeatSourceBaseComponent } from 'att-string-transcoder';

const componentVersion = 1;
const component = new HeatSourceBaseComponent({ version: componentVersion });

const time = component.time;
// `time` is `31557600000000000`

Methods

toBinary(version?)

See Component.toBinary(version?)


write(writer, version?)

See Component.write(writer, version?)