UNPKG

livesplit-core

Version:

livesplit-core is a library that provides a lot of functionality for creating a speedrun timer.

1,399 lines (1,398 loc) 167 kB
/** The state object for one of the components available. */ export declare type ComponentStateJson = { BlankSpace: BlankSpaceComponentStateJson; } | { CurrentComparison: CurrentComparisonComponentStateJson; } | { CurrentPace: CurrentPaceComponentStateJson; } | { Delta: DeltaComponentStateJson; } | { DetailedTimer: DetailedTimerComponentStateJson; } | { Graph: GraphComponentStateJson; } | { PossibleTimeSave: PossibleTimeSaveComponentStateJson; } | { PreviousSegment: PreviousSegmentComponentStateJson; } | { Separator: null; } | { Splits: SplitsComponentStateJson; } | { SumOfBest: SumOfBestComponentStateJson; } | { Text: TextComponentStateJson; } | { Timer: TimerComponentStateJson; } | { Title: TitleComponentStateJson; } | { TotalPlaytime: TotalPlaytimeComponentStateJson; }; /** * Colors can be used to describe what color to use for visualizing backgrounds, * texts, lines and various other elements that are being shown. They are stored * as RGBA colors with float point numbers ranging from 0.0 to 1.0 per channel. */ export declare type Color = number[]; /** * Describes a Gradient for coloring a region with more than just a single * color. */ export declare type Gradient = "Transparent" | { Plain: Color; } | { Vertical: Color[]; } | { Horizontal: Color[]; }; /** Describes the Alignment of the Title in the Title Component. */ export declare type Alignment = "Auto" | "Left" | "Center"; /** The state object describes the information to visualize for the layout. */ export interface LayoutStateJson { /** The state objects for all of the components in the layout. */ components: ComponentStateJson[]; /** The background to show behind the layout. */ background: Gradient; /** The color of thin separators. */ thin_separators_color: Color; /** The color of normal separators. */ separators_color: Color; /** The text color to use for text that doesn't specify its own color. */ text_color: Color; } /** * A Timing Method describes which form of timing is used. This can either be * Real Time or Game Time. */ export declare enum TimingMethod { /** * Real Time is the unmodified timing that is as close to an atomic clock as * possible. */ RealTime = 0, /** * Game Time describes the timing that is provided by the game that is being * run. This is entirely optional and may either be Real Time with loading * times removed or some time provided by the game. */ GameTime = 1 } /** * Describes which phase the timer is currently in. This tells you if there's an * active speedrun attempt and whether it is paused or it ended. */ export declare enum TimerPhase { /** There's currently no active attempt. */ NotRunning = 0, /** There's an active attempt that didn't end yet and isn't paused. */ Running = 1, /** There's an attempt that already ended, but didn't get reset yet. */ Ended = 2, /** There's an active attempt that is currently paused. */ Paused = 3 } /** The state object describes the information to visualize for this component. */ export interface BlankSpaceComponentStateJson { /** The background shown behind the component. */ background: Gradient; /** The height of the component. */ height: number; } /** The state object describes the information to visualize for this component. */ export interface TimerComponentStateJson { /** The background shown behind the component. */ background: Gradient; /** The time shown by the component without the fractional part. */ time: string; /** The fractional part of the time shown (including the dot). */ fraction: string; /** The semantic coloring information the time carries. */ semantic_color: SemanticColor; /** The top color of the timer's gradient. */ top_color: Color; /** The bottom color of the timer's gradient. */ bottom_color: Color; /** The height of the timer. */ height: number; } /** The state object describes the information to visualize for this component. */ export interface TitleComponentStateJson { /** The background shown behind the component. */ background: Gradient; /** * The color of the text. If `null` is specified, the color is taken from * the layout. */ text_color: Color | null; /** * The game's icon encoded as a Data URL. This value is only specified * whenever the icon changes. If you explicitly want to query this value, * remount the component. The String itself may be empty. This indicates * that there is no icon. */ icon_change: string | null; /** * The first title line to show. This is either the game's name, or a * combination of the game's name and the category. */ line1: string; /** * By default the category name is shown on the second line. Based on the * settings, it can however instead be shown in a single line together with * the game name. */ line2: string | null; /** * Specifies whether the title should centered or aligned to the left * instead. */ is_centered: boolean; /** * The amount of successfully finished attempts. If `null` is specified, the * amount of successfully finished attempts isn't supposed to be shown. */ finished_runs: number | null; /** * The amount of total attempts. If `null` is specified, the amount of total * attempts isn't supposed to be shown. */ attempts: number | null; } /** The state object describes the information to visualize for this component. */ export interface SplitsComponentStateJson { /** The list of all the segments to visualize. */ splits: SplitStateJson[]; /** * This list describes all the icon changes that happened. Each time a * segment is first shown or its icon changes, the new icon is provided in * this list. If necessary, you may remount this component to reset the * component into a state where these icons are provided again. */ icon_changes: SplitsComponentIconChangeJson[]; /** * Describes whether a more pronounced separator should be shown in front of * the last segment provided. */ show_final_separator: boolean; /** * The gradient to show behind the current segment as an indicator of it * being the current segment. */ current_split_gradient: Gradient; } /** * Describes the icon to be shown for a certain segment. This is provided * whenever a segment is first shown or whenever its icon changes. If necessary, * you may remount this component to reset the component into a state where * these icons are provided again. */ export interface SplitsComponentIconChangeJson { /** * The index of the segment of which the icon changed. This is based on the * index in the run, not on the index of the `SplitStateJson` in the * `SplitsComponentStateJson` object. The corresponding index is the `index` * field of the `SplitStateJson` object. */ segment_index: number; /** * The segment's icon encoded as a Data URL. The String itself may be empty. * This indicates that there is no icon. */ icon: string; } /** The state object that describes a single segment's information to visualize. */ export interface SplitStateJson { /** The name of the segment. */ name: string; /** The delta to show for this segment. */ delta: string; /** The split time to show for this segment. */ time: string; /** The semantic coloring information the delta time carries. */ semantic_color: SemanticColor; /** The visual color of the delta time. */ visual_color: Color; /** * Describes if this segment is the segment the active attempt is currently * on. */ is_current_split: boolean; /** * The index of the segment based on all the segments of the run. This may * differ from the index of this `SplitStateJson` in the * `SplitsComponentStateJson` object, as there can be a scrolling window, * showing only a subset of segments. */ index: number; } /** The state object describes the information to visualize for this component. */ export interface PreviousSegmentComponentStateJson { /** The background shown behind the component. */ background: Gradient; /** * The color of the label. If `null` is specified, the color is taken from * the layout. */ label_color: Color | null; /** The label's text. */ text: string; /** The delta (and possibly the possible time save). */ time: string; /** The semantic coloring information the delta time carries. */ semantic_color: SemanticColor; /** The visual color of the delta time. */ visual_color: Color; } /** The state object describes the information to visualize for this component. */ export interface SumOfBestComponentStateJson { /** The background shown behind the component. */ background: Gradient; /** * The color of the label. If `null` is specified, the color is taken from * the layout. */ label_color: Color | null; /** * The color of the value. If `null` is specified, the color is taken from * the layout. */ value_color: Color | null; /** The label's text. */ text: string; /** The sum of best segments. */ time: string; } /** The state object describes the information to visualize for this component. */ export interface PossibleTimeSaveComponentStateJson { /** The background shown behind the component. */ background: Gradient; /** * The color of the label. If `null` is specified, the color is taken from * the layout. */ label_color: Color | null; /** * The color of the value. If `null` is specified, the color is taken from * the layout. */ value_color: Color | null; /** The label's text. */ text: string; /** The current possible time save. */ time: string; } /** * The state object describes the information to visualize for this component. * All the coordinates are in the range 0..1. */ export interface GraphComponentStateJson { /** * All of the graph's points. Connect all of them to visualize the graph. If * the live delta is active, the last point is to be interpreted as a * preview of the next split that is about to happen. Use the partial fill * color to visualize the region beneath that graph segment. */ points: GraphComponentStatePointJson[]; /** Contains the y coordinates of all the horizontal grid lines. */ horizontal_grid_lines: number[]; /** Contains the x coordinates of all the vertical grid lines. */ vertical_grid_lines: number[]; /** * The y coordinate that separates the region that shows the times that are * ahead of the comparison and those that are behind. */ middle: number; /** * If the live delta is active, the last point is to be interpreted as a * preview of the next split that is about to happen. Use the partial fill * color to visualize the region beneath that graph segment. */ is_live_delta_active: boolean; /** * Describes whether the graph is flipped vertically. For visualizing the * graph, this usually doesn't need to be interpreted, as this information * is entirely encoded into the other variables. */ is_flipped: boolean; /** * The background color to use for the top region of the graph. The top * region ends at the y coordinate of the middle. */ top_background_color: Color; /** * The background color to use for the bottom region of the graph. The top * region begins at the y coordinate of the middle. */ bottom_background_color: Color; /** The color of the grid lines on the graph. */ grid_lines_color: Color; /** The color of the lines connecting all the graph's points. */ graph_lines_color: Color; /** * The color of the polygon connecting all the graph's points. The partial * fill color is only used for live changes. */ partial_fill_color: Color; /** The color of the polygon connecting all the graph's points. */ complete_fill_color: Color; /** * The best segment color to use for coloring graph segments that achieved a * new best segment time. */ best_segment_color: Color; /** The height of the graph. */ height: number; } /** Describes a point on the graph to visualize. */ export interface GraphComponentStatePointJson { /** The x coordinate of the point. */ x: number; /** The y coordinate of the point. */ y: number; /** * Describes whether the segment this point is visualizing achieved a new * best segment time. Use the best segment color for it, in that case. */ is_best_segment: boolean; } /** The state object describes the information to visualize for this component. */ export interface TextComponentStateJson { /** The background shown behind the component. */ background: Gradient; /** The text to show for the component. */ text: TextComponentStateText; } /** The text that is supposed to be shown. */ export declare type TextComponentStateText = { Center: string; } | { Split: string[]; }; /** The state object describes the information to visualize for this component. */ export interface TotalPlaytimeComponentStateJson { /** The background shown behind the component. */ background: Gradient; /** * The color of the label. If `null` is specified, the color is taken from * the layout. */ label_color: Color | null; /** * The color of the value. If `null` is specified, the color is taken from * the layout. */ value_color: Color | null; /** The label's text. */ text: string; /** The total playtime. */ time: string; } /** The state object describes the information to visualize for this component. */ export interface CurrentPaceComponentStateJson { /** The background shown behind the component. */ background: Gradient; /** * The color of the label. If `null` is specified, the color is taken from * the layout. */ label_color: Color | null; /** * The color of the value. If `null` is specified, the color is taken from * the layout. */ value_color: Color | null; /** The label's text. */ text: string; /** The current pace. */ time: string; } /** The state object describes the information to visualize for this component. */ export interface DeltaComponentStateJson { /** The background shown behind the component. */ background: Gradient; /** * The color of the label. If `null` is specified, the color is taken from * the layout. */ label_color: Color | null; /** The label's text. */ text: string; /** The delta. */ time: string; /** The semantic coloring information the delta time carries. */ semantic_color: SemanticColor; /** The visual color of the delta time. */ visual_color: Color; } /** The state object describes the information to visualize for this component. */ export interface CurrentComparisonComponentStateJson { /** The background shown behind the component. */ background: Gradient; /** * The color of the label. If `null` is specified, the color is taken from * the layout. */ label_color: Color | null; /** * The color of the value. If `null` is specified, the color is taken from * the layout. */ value_color: Color | null; /** The label's text. */ text: string; /** * The name of the comparison that is currently selected to be compared * against. */ comparison: string; } /** The state object describes the information to visualize for this component. */ export interface DetailedTimerComponentStateJson { /** The background shown behind the component. */ background: Gradient; /** The state of the attempt timer. */ timer: TimerComponentStateJson; /** The state of the segment timer. */ segment_timer: TimerComponentStateJson; /** The first comparison to visualize. */ comparison1: DetailedTimerComponentComparisonStateJson | null; /** The second comparison to visualize. */ comparison2: DetailedTimerComponentComparisonStateJson | null; /** * The name of the segment. This may be `null` if it's not supposed to be * visualized. */ segment_name: string | null; /** * The segment's icon encoded as a Data URL. This value is only specified * whenever the icon changes. If you explicitly want to query this value, * remount the component. The String itself may be empty. This indicates * that there is no icon. */ icon_change: string | null; } /** The state object describing a comparison to visualize. */ export interface DetailedTimerComponentComparisonStateJson { /** The name of the comparison. */ name: string; /** The time to show for the comparison. */ time: string; } /** * Represents the current state of the Layout Editor in order to visualize it * properly. */ export interface LayoutEditorStateJson { /** The name of all the components in the layout. */ components: string[]; /** Describes which actions are currently available. */ buttons: LayoutEditorButtonsJson; /** The index of the currently selected component. */ selected_component: number; /** * A generic description of the settings available for the selected * component and their current values. */ component_settings: SettingsDescriptionJson; /** * A generic description of the general settings available for the layout * and their current values. */ general_settings: SettingsDescriptionJson; } /** * Describes which actions are currently available. Depending on how many * components exist and which one is selected, only some actions can be executed * successfully. */ export interface LayoutEditorButtonsJson { /** * Describes whether the currently selected component can be removed. If * there's only one component in the layout, it can't be removed. */ can_remove: boolean; /** * Describes whether the currently selected component can be moved up. If * the first component is selected, it can't be moved. */ can_move_up: boolean; /** * Describes whether the currently selected component can be moved down. If * the last component is selected, it can't be moved. */ can_move_down: boolean; } /** A generic description of the settings available and their current values. */ export interface SettingsDescriptionJson { /** * All of the different settings that are available and their current * values. */ fields: SettingsDescriptionFieldJson[]; } /** A Field describes a single setting by its name and its current value. */ export interface SettingsDescriptionFieldJson { /** The name of the setting. */ text: string; /** The current value of the setting. */ value: SettingsDescriptionValueJson; } /** * Describes a setting's value. Such a value can be of a variety of different * types. */ export declare type SettingsDescriptionValueJson = { Bool: boolean; } | { UInt: number; } | { Int: number; } | { String: string; } | { OptionalString: string | null; } | { Float: number; } | { Accuracy: AccuracyJson; } | { DigitsFormat: DigitsFormatJson; } | { OptionalTimingMethod: TimingMethodJson | null; } | { Color: Color; } | { OptionalColor: Color | null; } | { Gradient: Gradient; } | { Alignment: Alignment; } | { CustomCombobox: CustomCombobox; }; /** * A custom Combobox containing its current value and a list of possible * values. */ export interface CustomCombobox { value: string; list: string[]; mandatory: boolean; } /** * The Accuracy describes how many digits to show for the fractional part of a * time. */ export declare type AccuracyJson = "Seconds" | "Tenths" | "Hundredths" | "Milliseconds"; /** * A Timing Method describes which form of timing is used. This can either be * Real Time or Game Time. */ export declare type TimingMethodJson = "RealTime" | "GameTime"; /** * A Digits Format describes how many digits of a time to always shown. The * times are prefixed by zeros to fill up the remaining digits. */ export declare type DigitsFormatJson = "SingleDigitSeconds" | "DoubleDigitSeconds" | "SingleDigitMinutes" | "DoubleDigitMinutes" | "SingleDigitHours" | "DoubleDigitHours"; /** * Represents the current state of the Run Editor in order to visualize it * properly. */ export interface RunEditorStateJson { /** * The game's icon encoded as a Data URL. This value is only specified * whenever the icon changes. The String itself may be empty. This * indicates that there is no icon. */ icon_change: string | null; /** The name of the game the Run is for. */ game: string; /** The name of the category the Run is for. */ category: string; /** * The timer offset specifies the time that the timer starts at when starting a * new attempt. */ offset: string; /** * The number of times this Run has been attempted by the runner. This * is mostly just a visual number and has no effect on any history. */ attempts: number; /** * The timing method that is currently selected to be visualized and * edited. */ timing_method: TimingMethodJson; /** The state of all the segments. */ segments: RunEditorRowJson[]; /** The names of all the custom comparisons that exist for this Run. */ comparison_names: string[]; /** Describes which actions are currently available. */ buttons: RunEditorButtonsJson; /** * Additional metadata of this Run, like the platform and region of the * game. */ metadata: RunMetadataJson; } /** * The Run Metadata stores additional information about a run, like the * platform and region of the game. All of this information is optional. */ export interface RunMetadataJson { /** * The speedrun.com Run ID of the run. You need to ensure that the record * on speedrun.com matches up with the Personal Best of this run. This may * be empty if there's no association. */ run_id: string; /** * The name of the platform this game is run on. This may be empty if it's * not specified. */ platform_name: string; /** * Specifies whether this speedrun is done on an emulator. Keep in mind * that `false` may also mean that this information is simply not known. */ uses_emulator: boolean; /** * The name of the region this game is from. This may be empty if it's not * specified. */ region_name: string; /** * Stores all the variables. A variable is an arbitrary key value pair * storing additional information about the category. An example of this * may be whether Amiibos are used in this category. */ variables: { [key: string]: string; }; } /** * Describes which actions are currently available. Depending on how many * segments exist and which ones are selected, only some actions can be * executed successfully. */ export interface RunEditorButtonsJson { /** * Describes whether the currently selected segments can be removed. If all * segments are selected, they can't be removed. */ can_remove: boolean; /** * Describes whether the currently selected segments can be moved up. If * any one of the selected segments is the first segment, then they can't * be moved. */ can_move_up: boolean; /** * Describes whether the currently selected segments can be moved down. If * any one of the selected segments is the last segment, then they can't be * moved. */ can_move_down: boolean; } /** Describes the current state of a segment. */ export interface RunEditorRowJson { /** * The segment's icon encoded as a Data URL. This value is only specified * whenever the icon changes. The String itself may be empty. This * indicates that there is no icon. */ icon_change: string | null; /** The name of the segment. */ name: string; /** The segment's split time for the active timing method. */ split_time: string; /** The segment time for the active timing method. */ segment_time: string; /** The best segment time for the active timing method. */ best_segment_time: string; /** * All of the times of the custom comparison for the active timing method. * The order of these matches up with the order of the custom comparisons * provided by the Run Editor's State object. */ comparison_times: string[]; /** Describes the segment's selection state. */ selected: "NotSelected" | "Selected" | "Active"; } /** * A Semantic Color describes a color by some meaningful event that is * happening. This information can be visualized as a color, but can also be * interpreted in other ways by the consumer of this API. */ export declare type SemanticColor = "Default" | "AheadGainingTime" | "AheadLosingTime" | "BehindLosingTime" | "BehindGainingTime" | "BestSegment" | "NotRunning" | "Paused" | "PersonalBest"; /** * The analysis module provides a variety of functions for calculating * information about runs. */ export declare class AnalysisRef { ptr: number; /** * This constructor is an implementation detail. Do not use this. */ constructor(ptr: number); } /** * The analysis module provides a variety of functions for calculating * information about runs. */ export declare class AnalysisRefMut extends AnalysisRef { } /** * The analysis module provides a variety of functions for calculating * information about runs. */ export declare class Analysis extends AnalysisRefMut { /** * Allows for scoped usage of the object. The object is guaranteed to get * disposed once this function returns. You are free to dispose the object * early yourself anywhere within the scope. The scope's return value gets * carried to the outside of this function. */ with<T>(closure: (obj: Analysis) => T): T; /** * Disposes the object, allowing it to clean up all of its memory. You need * to call this for every object that you don't use anymore and hasn't * already been disposed. */ dispose(): void; /** * Calculates the Sum of Best Segments for the timing method provided. This is * the fastest time possible to complete a run of a category, based on * information collected from all the previous attempts. This often matches up * with the sum of the best segment times of all the segments, but that may not * always be the case, as skipped segments may introduce combined segments that * may be faster than the actual sum of their best segment times. The name is * therefore a bit misleading, but sticks around for historical reasons. You * can choose to do a simple calculation instead, which excludes the Segment * History from the calculation process. If there's an active attempt, you can * choose to take it into account as well. Can return null. */ static calculateSumOfBest(run: RunRef, simpleCalculation: boolean, useCurrentRun: boolean, method: number): TimeSpan | null; /** * Calculates the total playtime of the passed Run. */ static calculateTotalPlaytimeForRun(run: RunRef): TimeSpan; /** * Calculates the total playtime of the passed Timer. */ static calculateTotalPlaytimeForTimer(timer: TimerRef): TimeSpan; } /** * An Atomic Date Time represents a UTC Date Time that tries to be as close to * an atomic clock as possible. */ export declare class AtomicDateTimeRef { ptr: number; /** * Represents whether the date time is actually properly derived from an * atomic clock. If the synchronization with the atomic clock didn't happen * yet or failed, this is set to false. */ isSynchronized(): boolean; /** * Converts this atomic date time into a RFC 2822 formatted date time. */ toRfc2822(): string; /** * Converts this atomic date time into a RFC 3339 formatted date time. */ toRfc3339(): string; /** * This constructor is an implementation detail. Do not use this. */ constructor(ptr: number); } /** * An Atomic Date Time represents a UTC Date Time that tries to be as close to * an atomic clock as possible. */ export declare class AtomicDateTimeRefMut extends AtomicDateTimeRef { } /** * An Atomic Date Time represents a UTC Date Time that tries to be as close to * an atomic clock as possible. */ export declare class AtomicDateTime extends AtomicDateTimeRefMut { /** * Allows for scoped usage of the object. The object is guaranteed to get * disposed once this function returns. You are free to dispose the object * early yourself anywhere within the scope. The scope's return value gets * carried to the outside of this function. */ with<T>(closure: (obj: AtomicDateTime) => T): T; /** * Disposes the object, allowing it to clean up all of its memory. You need * to call this for every object that you don't use anymore and hasn't * already been disposed. */ dispose(): void; } /** * An Attempt describes information about an attempt to run a specific category * by a specific runner in the past. Every time a new attempt is started and * then reset, an Attempt describing general information about it is created. */ export declare class AttemptRef { ptr: number; /** * Accesses the unique index of the attempt. This index is unique for the * Run, not for all of them. */ index(): number; /** * Accesses the split time of the last segment. If the attempt got reset * early and didn't finish, this may be empty. */ time(): TimeRef; /** * Accesses the amount of time the attempt has been paused for. If it is not * known, this returns null. This means that it may not necessarily be * possible to differentiate whether a Run has not been paused or it simply * wasn't stored. */ pauseTime(): TimeSpanRef | null; /** * Accesses the point in time the attempt was started at. This returns null * if this information is not known. */ started(): AtomicDateTime | null; /** * Accesses the point in time the attempt was ended at. This returns null if * this information is not known. */ ended(): AtomicDateTime | null; /** * This constructor is an implementation detail. Do not use this. */ constructor(ptr: number); } /** * An Attempt describes information about an attempt to run a specific category * by a specific runner in the past. Every time a new attempt is started and * then reset, an Attempt describing general information about it is created. */ export declare class AttemptRefMut extends AttemptRef { } /** * An Attempt describes information about an attempt to run a specific category * by a specific runner in the past. Every time a new attempt is started and * then reset, an Attempt describing general information about it is created. */ export declare class Attempt extends AttemptRefMut { /** * Allows for scoped usage of the object. The object is guaranteed to get * disposed once this function returns. You are free to dispose the object * early yourself anywhere within the scope. The scope's return value gets * carried to the outside of this function. */ with<T>(closure: (obj: Attempt) => T): T; /** * Disposes the object, allowing it to clean up all of its memory. You need * to call this for every object that you don't use anymore and hasn't * already been disposed. */ dispose(): void; } /** * The Blank Space Component is simply an empty component that doesn't show * anything other than a background. It mostly serves as padding between other * components. */ export declare class BlankSpaceComponentRef { ptr: number; /** * This constructor is an implementation detail. Do not use this. */ constructor(ptr: number); } /** * The Blank Space Component is simply an empty component that doesn't show * anything other than a background. It mostly serves as padding between other * components. */ export declare class BlankSpaceComponentRefMut extends BlankSpaceComponentRef { /** * Encodes the component's state information as JSON. */ stateAsJson(timer: TimerRef): any; /** * Calculates the component's state based on the timer provided. */ state(timer: TimerRef): BlankSpaceComponentState; } /** * The Blank Space Component is simply an empty component that doesn't show * anything other than a background. It mostly serves as padding between other * components. */ export declare class BlankSpaceComponent extends BlankSpaceComponentRefMut { /** * Allows for scoped usage of the object. The object is guaranteed to get * disposed once this function returns. You are free to dispose the object * early yourself anywhere within the scope. The scope's return value gets * carried to the outside of this function. */ with<T>(closure: (obj: BlankSpaceComponent) => T): T; /** * Disposes the object, allowing it to clean up all of its memory. You need * to call this for every object that you don't use anymore and hasn't * already been disposed. */ dispose(): void; /** * Creates a new Blank Space Component. */ static new(): BlankSpaceComponent; /** * Converts the component into a generic component suitable for using with a * layout. */ intoGeneric(): Component; } /** * The state object describes the information to visualize for this component. */ export declare class BlankSpaceComponentStateRef { ptr: number; /** * The height of the component. */ height(): number; /** * This constructor is an implementation detail. Do not use this. */ constructor(ptr: number); } /** * The state object describes the information to visualize for this component. */ export declare class BlankSpaceComponentStateRefMut extends BlankSpaceComponentStateRef { } /** * The state object describes the information to visualize for this component. */ export declare class BlankSpaceComponentState extends BlankSpaceComponentStateRefMut { /** * Allows for scoped usage of the object. The object is guaranteed to get * disposed once this function returns. You are free to dispose the object * early yourself anywhere within the scope. The scope's return value gets * carried to the outside of this function. */ with<T>(closure: (obj: BlankSpaceComponentState) => T): T; /** * Disposes the object, allowing it to clean up all of its memory. You need * to call this for every object that you don't use anymore and hasn't * already been disposed. */ dispose(): void; } /** * A Component provides information about a run in a way that is easy to * visualize. This type can store any of the components provided by this crate. */ export declare class ComponentRef { ptr: number; /** * This constructor is an implementation detail. Do not use this. */ constructor(ptr: number); } /** * A Component provides information about a run in a way that is easy to * visualize. This type can store any of the components provided by this crate. */ export declare class ComponentRefMut extends ComponentRef { } /** * A Component provides information about a run in a way that is easy to * visualize. This type can store any of the components provided by this crate. */ export declare class Component extends ComponentRefMut { /** * Allows for scoped usage of the object. The object is guaranteed to get * disposed once this function returns. You are free to dispose the object * early yourself anywhere within the scope. The scope's return value gets * carried to the outside of this function. */ with<T>(closure: (obj: Component) => T): T; /** * Disposes the object, allowing it to clean up all of its memory. You need * to call this for every object that you don't use anymore and hasn't * already been disposed. */ dispose(): void; } /** * The Current Comparison Component is a component that shows the name of the * comparison that is currently selected to be compared against. */ export declare class CurrentComparisonComponentRef { ptr: number; /** * This constructor is an implementation detail. Do not use this. */ constructor(ptr: number); } /** * The Current Comparison Component is a component that shows the name of the * comparison that is currently selected to be compared against. */ export declare class CurrentComparisonComponentRefMut extends CurrentComparisonComponentRef { /** * Encodes the component's state information as JSON. */ stateAsJson(timer: TimerRef): any; /** * Calculates the component's state based on the timer provided. */ state(timer: TimerRef): CurrentComparisonComponentState; } /** * The Current Comparison Component is a component that shows the name of the * comparison that is currently selected to be compared against. */ export declare class CurrentComparisonComponent extends CurrentComparisonComponentRefMut { /** * Allows for scoped usage of the object. The object is guaranteed to get * disposed once this function returns. You are free to dispose the object * early yourself anywhere within the scope. The scope's return value gets * carried to the outside of this function. */ with<T>(closure: (obj: CurrentComparisonComponent) => T): T; /** * Disposes the object, allowing it to clean up all of its memory. You need * to call this for every object that you don't use anymore and hasn't * already been disposed. */ dispose(): void; /** * Creates a new Current Comparison Component. */ static new(): CurrentComparisonComponent; /** * Converts the component into a generic component suitable for using with a * layout. */ intoGeneric(): Component; } /** * The state object describes the information to visualize for this component. */ export declare class CurrentComparisonComponentStateRef { ptr: number; /** * The label's text. */ text(): string; /** * The name of the comparison that is currently selected to be compared * against. */ comparison(): string; /** * This constructor is an implementation detail. Do not use this. */ constructor(ptr: number); } /** * The state object describes the information to visualize for this component. */ export declare class CurrentComparisonComponentStateRefMut extends CurrentComparisonComponentStateRef { } /** * The state object describes the information to visualize for this component. */ export declare class CurrentComparisonComponentState extends CurrentComparisonComponentStateRefMut { /** * Allows for scoped usage of the object. The object is guaranteed to get * disposed once this function returns. You are free to dispose the object * early yourself anywhere within the scope. The scope's return value gets * carried to the outside of this function. */ with<T>(closure: (obj: CurrentComparisonComponentState) => T): T; /** * Disposes the object, allowing it to clean up all of its memory. You need * to call this for every object that you don't use anymore and hasn't * already been disposed. */ dispose(): void; } /** * The Current Pace Component is a component that shows a prediction of the * current attempt's final time, if the current attempt's pace matches the * chosen comparison for the remainder of the run. */ export declare class CurrentPaceComponentRef { ptr: number; /** * This constructor is an implementation detail. Do not use this. */ constructor(ptr: number); } /** * The Current Pace Component is a component that shows a prediction of the * current attempt's final time, if the current attempt's pace matches the * chosen comparison for the remainder of the run. */ export declare class CurrentPaceComponentRefMut extends CurrentPaceComponentRef { /** * Encodes the component's state information as JSON. */ stateAsJson(timer: TimerRef): any; /** * Calculates the component's state based on the timer provided. */ state(timer: TimerRef): CurrentPaceComponentState; } /** * The Current Pace Component is a component that shows a prediction of the * current attempt's final time, if the current attempt's pace matches the * chosen comparison for the remainder of the run. */ export declare class CurrentPaceComponent extends CurrentPaceComponentRefMut { /** * Allows for scoped usage of the object. The object is guaranteed to get * disposed once this function returns. You are free to dispose the object * early yourself anywhere within the scope. The scope's return value gets * carried to the outside of this function. */ with<T>(closure: (obj: CurrentPaceComponent) => T): T; /** * Disposes the object, allowing it to clean up all of its memory. You need * to call this for every object that you don't use anymore and hasn't * already been disposed. */ dispose(): void; /** * Creates a new Current Pace Component. */ static new(): CurrentPaceComponent; /** * Converts the component into a generic component suitable for using with a * layout. */ intoGeneric(): Component; } /** * The state object describes the information to visualize for this component. */ export declare class CurrentPaceComponentStateRef { ptr: number; /** * The label's text. */ text(): string; /** * The current pace. */ time(): string; /** * This constructor is an implementation detail. Do not use this. */ constructor(ptr: number); } /** * The state object describes the information to visualize for this component. */ export declare class CurrentPaceComponentStateRefMut extends CurrentPaceComponentStateRef { } /** * The state object describes the information to visualize for this component. */ export declare class CurrentPaceComponentState extends CurrentPaceComponentStateRefMut { /** * Allows for scoped usage of the object. The object is guaranteed to get * disposed once this function returns. You are free to dispose the object * early yourself anywhere within the scope. The scope's return value gets * carried to the outside of this function. */ with<T>(closure: (obj: CurrentPaceComponentState) => T): T; /** * Disposes the object, allowing it to clean up all of its memory. You need * to call this for every object that you don't use anymore and hasn't * already been disposed. */ dispose(): void; } /** * The Delta Component is a component that shows the how far ahead or behind * the current attempt is compared to the chosen comparison. */ export declare class DeltaComponentRef { ptr: number; /** * This constructor is an implementation detail. Do not use this. */ constructor(ptr: number); } /** * The Delta Component is a component that shows the how far ahead or behind * the current attempt is compared to the chosen comparison. */ export declare class DeltaComponentRefMut extends DeltaComponentRef { /** * Encodes the component's state information as JSON. */ stateAsJson(timer: TimerRef, layoutSettings: GeneralLayoutSettingsRef): any; /** * Calculates the component's state based on the timer and the layout * settings provided. */ state(timer: TimerRef, layoutSettings: GeneralLayoutSettingsRef): DeltaComponentState; } /** * The Delta Component is a component that shows the how far ahead or behind * the current attempt is compared to the chosen comparison. */ export declare class DeltaComponent extends DeltaComponentRefMut { /** * Allows for scoped usage of the object. The object is guaranteed to get * disposed once this function returns. You are free to dispose the object * early yourself anywhere within the scope. The scope's return value gets * carried to the outside of this function. */ with<T>(closure: (obj: DeltaComponent) => T): T; /** * Disposes the object, allowing it to clean up all of its memory. You need * to call this for every object that you don't use anymore and hasn't * already been disposed. */ dispose(): void; /** * Creates a new Delta Component. */ static new(): DeltaComponent; /** * Converts the component into a generic component suitable for using with a * layout. */ intoGeneric(): Component; } /** * The state object describes the information to visualize for this component. */ export declare class DeltaComponentStateRef { ptr: number; /** * The label's text. */ text(): string; /** * The delta. */ time(): string; /** * The semantic coloring information the delta time carries. */ semanticColor(): string; /** * This constructor is an implementation detail. Do not use this. */ constructor(ptr: number); } /** * The state object describes the information to visualize for this component. */ export declare class DeltaComponentStateRefMut extends DeltaComponentStateRef { } /** * The state object describes the information to visualize for this component. */ export declare class DeltaComponentState extends DeltaComponentStateRefMut { /** * Allows for scoped usage of the object. The object is guaranteed to get * disposed once this function returns. You are free to dispose the object * early yourself anywhere within the scope. The scope's return value gets * carried to the outside of this function. */ with<T>(closure: (obj: DeltaComponentState) => T): T; /** * Disposes the object, allowing it to clean up all of its memory. You need * to call this for every object that you don't use anymore and hasn't * already been disposed. */ dispose(): void; } /** * The Detailed Timer Component is a component that shows two timers, one for * the total time of the current attempt and one showing the time of just the * current segment. Other information, like segment times of up to two * comparisons, the segment icon, and the segment's name, can also be shown. */ export declare class DetailedTimerComponentRef { ptr: number; /** * This constructor is an implementation detail. Do not use this. */ constructor(ptr: number); } /** * The Detailed Timer Component is a component that shows two timers, one for * the total time of the current attempt and one showing the time of just the * current segment. Other information, like segment times of up to two * comparisons, the segment icon, and the segment's name, can also be shown. */ export declare class DetailedTimerComponentRefMut extends DetailedTimerComponentRef { /** * Encodes the component's state information as JSON. */ stateAsJson(timer: TimerRef, layoutSettings: GeneralLayoutSettingsRef): any; /** * Calculates the component's state based on the timer and layout settings * provided. */ state(timer: TimerRef, layoutSettings: GeneralLayoutSettingsRef): DetailedTimerComponentState; } /** * The Detailed Timer Component is a component that shows two timers, one for * the total time of the current attempt and one showing the time of just the * current segment. Other information, like segment times of up to two * comparisons, the segment icon, and the segment's name, can also be shown. */ export declare class DetailedTimerComponent extends DetailedTimerComponentRefMut { /** * Allows for scoped usage of the object. The object is guaranteed to get * disposed once this function returns. You are free to dispose the object * early yourself anywhere within the scope. The scope's return value gets * carried to the outside of this function. */ with<T>(closure: (obj: DetailedTimerComponent) => T): T; /** * Disposes the object, allowing it to clean up all of its memory. You need * to call this for every object that you don't use anymore and hasn't * already been disposed. */ dispose(): void; /** * Creates a new Detailed Timer Component. */ static new(): DetailedTimerComponent; /** * Converts the component into a generic component suitable for using with a * layout. */ intoGeneric(): Component; } /** * The state object describes the information to visualize for this component. */ export declare class DetailedTimerComponentStateRef { ptr: number; /** * The time shown by the component's main timer without the fractional part. */ timerTime(): string; /** * The fractional part of the time shown by the main timer (including the dot). */ timerFraction(): string; /** * The semantic coloring information the main timer's time carries.