UNPKG

@cruncheevos/core

Version:

Parse and generate achievements and leaderboards for RetroAchievements.org

1,105 lines 69.2 kB
import { Condition } from './condition.js'; import { ConditionBuilder } from './define.js'; export declare namespace RichPresence { type Format = 'VALUE' | 'SCORE' | 'POINTS' | 'TIME' | 'FRAMES' | 'MILLISECS' | 'SECS' | 'MINUTES' | 'SECS_AS_MINS' | 'FLOAT1' | 'FLOAT2' | 'FLOAT3' | 'FLOAT4' | 'FLOAT5' | 'FLOAT6'; /** * Specifies how keys should look like in string representation of the Lookup * Default is `'dec'` */ type LookupKeyFormat = 'dec' | 'hex' | 'hex-lowercase'; interface LookupParams { /** Name of this Rich Presence Lookup */ name: string; /** Object representing values of this Rich Presence Lookup, key must be a number or '*' */ values: Record<string | number, string>; /** Specifies default memory address or conditions representing it, which can be used when passing the Lookup instance to the {@link RichPresence.tag} function */ defaultAt?: string | Condition | ConditionBuilder; /** * Specifies if same Lookup values should be contained within a key range if possible * Default is `true` * * @example * import { RichPresence } from '@cruncheevos/core' * const values = { 1: 'Same', 2: 'Same' } * const withCompress = RichPresence.lookup({ name: 'Car', values }) * const withoutCompress = RichPresence.lookup({ name: 'Car', values, compressRanges: true }) * * withCompress.toString() // 'Lookup:Car\n1-2=Same' * withoutCompress.toString() // 'Lookup:Car\n1=Same\n2=Same' */ compressRanges?: boolean; } interface FormatParams { /** Name of this Rich Presence Format */ name: string; /** Type of this Rich Presence Format, such as SCORE, FRAMES, etc. */ type: Format; } interface Params<L, F> { lookupDefaultParameters?: { compressRanges?: RichPresence.LookupParams['compressRanges']; keyFormat?: RichPresence.LookupKeyFormat; }; /** * An object wrapping calls to {@link RichPresence.format} * * Key specifies Format name, value specifies Format type. * */ format?: F; /** * An object wrapping calls to {@link RichPresence.lookup} * * Key specifies Lookup name, value specifies parameters that * will get passed to {@link RichPresence.lookup} (except name). * */ lookup?: L; /** * Callback providing previously specified Rich Presence Formats * and Lookups, also provides Macros and {@link RichPresence.tag} function. * * This callback expects you to return an array of display strings. * See example for {@link RichPresence}. */ displays: (params: { lookup: { [x in keyof L]: ReturnType<typeof makeRichPresenceLookup>; }; format: { [x in keyof F]: ReturnType<typeof makeRichPresenceFormat>; }; tag: typeof taggedDisplayString; macro: typeof RichPresence.macro; }) => Array<string | [Condition.Input | ConditionBuilder, string]>; } } declare const richLookup: unique symbol; declare function taggedDisplayString(strings: TemplateStringsArray, ...args: Array<string | Condition | ConditionBuilder | ReturnType<typeof makeRichPresenceLookup>>): string; declare function makeRichPresenceDisplay(condition: Condition.Input | ConditionBuilder, displayString: string): string; declare function makeRichPresenceFormat(params: RichPresence.FormatParams): { /** Name of this Rich Presence Format */ name: string; /** Type of this Rich Presence Format, such as SCORE, FRAMES, etc. */ type: RichPresence.Format; /** * Returns string representation of Rich Presence Format definition * * @example * import { RichPresence } from '@cruncheevos/core' * const format = RichPresence.format({ name: 'Score', type: 'VALUE' }) * format.toString() // 'Format:Score\nFormatType=VALUE' */ toString(): string; /** * Returns string representation of Rich PresenceFormat macro call * * If there's only one condition - output may be shortened. * * When passing Condition or ConditionBuilder - you must have * at least one condition marked as Measured. * * Legacy value format is only supported by passing a string. * * @example * import { define as $, RichPresence } from '@cruncheevos/core' * * const format = RichPresence.format({ name: 'Score', type: 'VALUE' }) * format.at('0xcafe_v1') // '@Car(0xcafe_v1)' * format.at($(['Measured', 'Mem', 'Float', 0xCAFE])) // '@Car(fFcafe)' */ at(input: string | Condition | ConditionBuilder): string; }; declare function makeRichPresenceLookup(params: RichPresence.LookupParams): { [richLookup]: boolean; /** Name of this Rich Presence Lookup */ name: string; /** * Returns string representation of Rich Presence Lookup definition * * @param {RichPresence.LookupKeyFormat} keyFormat defines how to format Lookup keys, defaults to `'dec'` * * @example * import { RichPresence } from '@cruncheevos/core' * const format = RichPresence.format({ name: 'Score', type: 'VALUE' }) * lookup.toString() // `Lookup:Car\n0x1=First!\n0x2=Second!\n0x4-0x5=Same' */ toString(keyFormat?: RichPresence.LookupKeyFormat): string; at: { /** * Returns string representation of Lookup call * * If there's only one condition - output may be shortened. * * When passing Condition or ConditionBuilder - you must have * at least one condition marked as Measured. * * Legacy value format is only supported by passing a string. * * @example * import { define as $, RichPresence } from '@cruncheevos/core' * * const lookup = RichPresence.lookup({ name: 'Car', values: { ... } }) * lookup.at('0xcafe_v1') // '@Car(0xcafe_v1)' * lookup.at($(['Measured', 'Mem', 'Float', 0xCAFE])) // '@Car(fFcafe)' */ (conditionInput: string | Condition | ConditionBuilder): string; /** * Returns string representation of Lookup call with previously set `defaultAt` property * * If there's only one condition - output may be shortened. * * If `defaultAt` is Condition or ConditionBuilder - it must have * at least one condition marked as Measured. * * Legacy value format is only supported by setting `defaultAt` as string. * * @example * import { RichPresence } from '@cruncheevos/core' * * const lookup = RichPresence.lookup({ name: 'Car', defaultAt: '0xCAFE', values: { ... } }) * lookup.at() // '@Car(0xCAFE)' */ (): string; }; }; /** * Provides declarative API to produce Rich Presence string * * @example * import { define as $, RichPresence } from '@cruncheevos/core' * * RichPresence({ * lookupDefaultParameters: { keyFormat: 'hex', compressRanges: true }, * // Wraps calls to RichPresence.format * format: { * Score: 'VALUE', * }, * // Wraps calls to RichPresence.lookup * lookup: { * Song: { * // No need to specify name, it's taken from object * values: { * '*': 'Unknown value', * 1: 'Same value', * 2: 'Same value', * 3: 'Same value', * }, * // overrides lookupDefaultParameters.keyFormat * keyFormat: 'dec', * defaultAt: 0x100, * }, * Mode: { * values: { * 1: 'Mode 1', * 2: 'Mode 2', * }, * // overrides lookupDefaultParameters.compressRanges * compressRanges: false * }, * }, * // Callback function that must return an array of display strings. * // All the previously specified Lookups and Formats are provided * // through `lookup` and `format` objects respectively, * // along with the `tag` function to inject lookups into display strings. * displays: ({ lookup, format, macro, tag }) => [ * [ * $(['', 'Mem', '16bit', 0xcafe, '=', 'Value', '', 1]), * * // Passing lookup.Song to this tagged template literal function causes * // `lookup.Song.at()` call with previosly set `defaultAt` value * tag`Cafe at value 1, Song: ${lookup.Song}, Mode: ${lookup.Mode.at(0x990)}`, * ], * * ['0xCAFE=2', tag`Cafe at value 2, format example: ${format.Score.at(0x600)}`], * * // `macro` is an object providing several pre-existing Formats * ['0xCAFE=3', tag`Default macro test ${macro.Score.at('0xfeed')}`], * 'Playing a good game', * ], * }) * * `Format:Score * FormatType=VALUE * * Lookup:Song * 1-3=Same value * *=Unknown value * * Lookup:Mode * 0x1=Mode 1 * 0x2=Mode 2 * * Display: * ?0x cafe=1?Cafe at value 1, Song: @Song(0x100), Mode: @Mode(0x990) * ?0xCAFE=2?Cafe at value 2, format example: @Score(0x600) * ?0xCAFE=3?Default macro test @Score(0xfeed) * Playing a good game` */ export declare const RichPresence: { <L extends Record<string, { values: RichPresence.LookupParams["values"]; keyFormat?: RichPresence.LookupKeyFormat; defaultAt?: RichPresence.LookupParams["defaultAt"]; compressRanges?: RichPresence.LookupParams["compressRanges"]; }>, F extends Record<string, RichPresence.Format>>(params: RichPresence.Params<L, F>): { lookup: { [x in keyof L]: { [richLookup]: boolean; /** Name of this Rich Presence Lookup */ name: string; /** * Returns string representation of Rich Presence Lookup definition * * @param {RichPresence.LookupKeyFormat} keyFormat defines how to format Lookup keys, defaults to `'dec'` * * @example * import { RichPresence } from '@cruncheevos/core' * const format = RichPresence.format({ name: 'Score', type: 'VALUE' }) * lookup.toString() // `Lookup:Car\n0x1=First!\n0x2=Second!\n0x4-0x5=Same' */ toString(keyFormat?: RichPresence.LookupKeyFormat): string; at: { /** * Returns string representation of Lookup call * * If there's only one condition - output may be shortened. * * When passing Condition or ConditionBuilder - you must have * at least one condition marked as Measured. * * Legacy value format is only supported by passing a string. * * @example * import { define as $, RichPresence } from '@cruncheevos/core' * * const lookup = RichPresence.lookup({ name: 'Car', values: { ... } }) * lookup.at('0xcafe_v1') // '@Car(0xcafe_v1)' * lookup.at($(['Measured', 'Mem', 'Float', 0xCAFE])) // '@Car(fFcafe)' */ (conditionInput: string | Condition | ConditionBuilder): string; /** * Returns string representation of Lookup call with previously set `defaultAt` property * * If there's only one condition - output may be shortened. * * If `defaultAt` is Condition or ConditionBuilder - it must have * at least one condition marked as Measured. * * Legacy value format is only supported by setting `defaultAt` as string. * * @example * import { RichPresence } from '@cruncheevos/core' * * const lookup = RichPresence.lookup({ name: 'Car', defaultAt: '0xCAFE', values: { ... } }) * lookup.at() // '@Car(0xCAFE)' */ (): string; }; }; }; format: { [x_1 in keyof F]: { /** Name of this Rich Presence Format */ name: string; /** Type of this Rich Presence Format, such as SCORE, FRAMES, etc. */ type: RichPresence.Format; /** * Returns string representation of Rich Presence Format definition * * @example * import { RichPresence } from '@cruncheevos/core' * const format = RichPresence.format({ name: 'Score', type: 'VALUE' }) * format.toString() // 'Format:Score\nFormatType=VALUE' */ toString(): string; /** * Returns string representation of Rich PresenceFormat macro call * * If there's only one condition - output may be shortened. * * When passing Condition or ConditionBuilder - you must have * at least one condition marked as Measured. * * Legacy value format is only supported by passing a string. * * @example * import { define as $, RichPresence } from '@cruncheevos/core' * * const format = RichPresence.format({ name: 'Score', type: 'VALUE' }) * format.at('0xcafe_v1') // '@Car(0xcafe_v1)' * format.at($(['Measured', 'Mem', 'Float', 0xCAFE])) // '@Car(fFcafe)' */ at(input: string | Condition | ConditionBuilder): string; }; }; displayStrings: string[]; macro: { Number: { /** Name of this Rich Presence Format */ name: string; /** Type of this Rich Presence Format, such as SCORE, FRAMES, etc. */ type: RichPresence.Format; /** * Returns string representation of Rich Presence Format definition * * @example * import { RichPresence } from '@cruncheevos/core' * const format = RichPresence.format({ name: 'Score', type: 'VALUE' }) * format.toString() // 'Format:Score\nFormatType=VALUE' */ toString(): string; /** * Returns string representation of Rich PresenceFormat macro call * * If there's only one condition - output may be shortened. * * When passing Condition or ConditionBuilder - you must have * at least one condition marked as Measured. * * Legacy value format is only supported by passing a string. * * @example * import { define as $, RichPresence } from '@cruncheevos/core' * * const format = RichPresence.format({ name: 'Score', type: 'VALUE' }) * format.at('0xcafe_v1') // '@Car(0xcafe_v1)' * format.at($(['Measured', 'Mem', 'Float', 0xCAFE])) // '@Car(fFcafe)' */ at(input: string | Condition | ConditionBuilder): string; }; Unsigned: { /** Name of this Rich Presence Format */ name: string; /** Type of this Rich Presence Format, such as SCORE, FRAMES, etc. */ type: RichPresence.Format; /** * Returns string representation of Rich Presence Format definition * * @example * import { RichPresence } from '@cruncheevos/core' * const format = RichPresence.format({ name: 'Score', type: 'VALUE' }) * format.toString() // 'Format:Score\nFormatType=VALUE' */ toString(): string; /** * Returns string representation of Rich PresenceFormat macro call * * If there's only one condition - output may be shortened. * * When passing Condition or ConditionBuilder - you must have * at least one condition marked as Measured. * * Legacy value format is only supported by passing a string. * * @example * import { define as $, RichPresence } from '@cruncheevos/core' * * const format = RichPresence.format({ name: 'Score', type: 'VALUE' }) * format.at('0xcafe_v1') // '@Car(0xcafe_v1)' * format.at($(['Measured', 'Mem', 'Float', 0xCAFE])) // '@Car(fFcafe)' */ at(input: string | Condition | ConditionBuilder): string; }; Score: { /** Name of this Rich Presence Format */ name: string; /** Type of this Rich Presence Format, such as SCORE, FRAMES, etc. */ type: RichPresence.Format; /** * Returns string representation of Rich Presence Format definition * * @example * import { RichPresence } from '@cruncheevos/core' * const format = RichPresence.format({ name: 'Score', type: 'VALUE' }) * format.toString() // 'Format:Score\nFormatType=VALUE' */ toString(): string; /** * Returns string representation of Rich PresenceFormat macro call * * If there's only one condition - output may be shortened. * * When passing Condition or ConditionBuilder - you must have * at least one condition marked as Measured. * * Legacy value format is only supported by passing a string. * * @example * import { define as $, RichPresence } from '@cruncheevos/core' * * const format = RichPresence.format({ name: 'Score', type: 'VALUE' }) * format.at('0xcafe_v1') // '@Car(0xcafe_v1)' * format.at($(['Measured', 'Mem', 'Float', 0xCAFE])) // '@Car(fFcafe)' */ at(input: string | Condition | ConditionBuilder): string; }; Centiseconds: { /** Name of this Rich Presence Format */ name: string; /** Type of this Rich Presence Format, such as SCORE, FRAMES, etc. */ type: RichPresence.Format; /** * Returns string representation of Rich Presence Format definition * * @example * import { RichPresence } from '@cruncheevos/core' * const format = RichPresence.format({ name: 'Score', type: 'VALUE' }) * format.toString() // 'Format:Score\nFormatType=VALUE' */ toString(): string; /** * Returns string representation of Rich PresenceFormat macro call * * If there's only one condition - output may be shortened. * * When passing Condition or ConditionBuilder - you must have * at least one condition marked as Measured. * * Legacy value format is only supported by passing a string. * * @example * import { define as $, RichPresence } from '@cruncheevos/core' * * const format = RichPresence.format({ name: 'Score', type: 'VALUE' }) * format.at('0xcafe_v1') // '@Car(0xcafe_v1)' * format.at($(['Measured', 'Mem', 'Float', 0xCAFE])) // '@Car(fFcafe)' */ at(input: string | Condition | ConditionBuilder): string; }; Seconds: { /** Name of this Rich Presence Format */ name: string; /** Type of this Rich Presence Format, such as SCORE, FRAMES, etc. */ type: RichPresence.Format; /** * Returns string representation of Rich Presence Format definition * * @example * import { RichPresence } from '@cruncheevos/core' * const format = RichPresence.format({ name: 'Score', type: 'VALUE' }) * format.toString() // 'Format:Score\nFormatType=VALUE' */ toString(): string; /** * Returns string representation of Rich PresenceFormat macro call * * If there's only one condition - output may be shortened. * * When passing Condition or ConditionBuilder - you must have * at least one condition marked as Measured. * * Legacy value format is only supported by passing a string. * * @example * import { define as $, RichPresence } from '@cruncheevos/core' * * const format = RichPresence.format({ name: 'Score', type: 'VALUE' }) * format.at('0xcafe_v1') // '@Car(0xcafe_v1)' * format.at($(['Measured', 'Mem', 'Float', 0xCAFE])) // '@Car(fFcafe)' */ at(input: string | Condition | ConditionBuilder): string; }; Minutes: { /** Name of this Rich Presence Format */ name: string; /** Type of this Rich Presence Format, such as SCORE, FRAMES, etc. */ type: RichPresence.Format; /** * Returns string representation of Rich Presence Format definition * * @example * import { RichPresence } from '@cruncheevos/core' * const format = RichPresence.format({ name: 'Score', type: 'VALUE' }) * format.toString() // 'Format:Score\nFormatType=VALUE' */ toString(): string; /** * Returns string representation of Rich PresenceFormat macro call * * If there's only one condition - output may be shortened. * * When passing Condition or ConditionBuilder - you must have * at least one condition marked as Measured. * * Legacy value format is only supported by passing a string. * * @example * import { define as $, RichPresence } from '@cruncheevos/core' * * const format = RichPresence.format({ name: 'Score', type: 'VALUE' }) * format.at('0xcafe_v1') // '@Car(0xcafe_v1)' * format.at($(['Measured', 'Mem', 'Float', 0xCAFE])) // '@Car(fFcafe)' */ at(input: string | Condition | ConditionBuilder): string; }; Fixed1: { /** Name of this Rich Presence Format */ name: string; /** Type of this Rich Presence Format, such as SCORE, FRAMES, etc. */ type: RichPresence.Format; /** * Returns string representation of Rich Presence Format definition * * @example * import { RichPresence } from '@cruncheevos/core' * const format = RichPresence.format({ name: 'Score', type: 'VALUE' }) * format.toString() // 'Format:Score\nFormatType=VALUE' */ toString(): string; /** * Returns string representation of Rich PresenceFormat macro call * * If there's only one condition - output may be shortened. * * When passing Condition or ConditionBuilder - you must have * at least one condition marked as Measured. * * Legacy value format is only supported by passing a string. * * @example * import { define as $, RichPresence } from '@cruncheevos/core' * * const format = RichPresence.format({ name: 'Score', type: 'VALUE' }) * format.at('0xcafe_v1') // '@Car(0xcafe_v1)' * format.at($(['Measured', 'Mem', 'Float', 0xCAFE])) // '@Car(fFcafe)' */ at(input: string | Condition | ConditionBuilder): string; }; Fixed2: { /** Name of this Rich Presence Format */ name: string; /** Type of this Rich Presence Format, such as SCORE, FRAMES, etc. */ type: RichPresence.Format; /** * Returns string representation of Rich Presence Format definition * * @example * import { RichPresence } from '@cruncheevos/core' * const format = RichPresence.format({ name: 'Score', type: 'VALUE' }) * format.toString() // 'Format:Score\nFormatType=VALUE' */ toString(): string; /** * Returns string representation of Rich PresenceFormat macro call * * If there's only one condition - output may be shortened. * * When passing Condition or ConditionBuilder - you must have * at least one condition marked as Measured. * * Legacy value format is only supported by passing a string. * * @example * import { define as $, RichPresence } from '@cruncheevos/core' * * const format = RichPresence.format({ name: 'Score', type: 'VALUE' }) * format.at('0xcafe_v1') // '@Car(0xcafe_v1)' * format.at($(['Measured', 'Mem', 'Float', 0xCAFE])) // '@Car(fFcafe)' */ at(input: string | Condition | ConditionBuilder): string; }; Fixed3: { /** Name of this Rich Presence Format */ name: string; /** Type of this Rich Presence Format, such as SCORE, FRAMES, etc. */ type: RichPresence.Format; /** * Returns string representation of Rich Presence Format definition * * @example * import { RichPresence } from '@cruncheevos/core' * const format = RichPresence.format({ name: 'Score', type: 'VALUE' }) * format.toString() // 'Format:Score\nFormatType=VALUE' */ toString(): string; /** * Returns string representation of Rich PresenceFormat macro call * * If there's only one condition - output may be shortened. * * When passing Condition or ConditionBuilder - you must have * at least one condition marked as Measured. * * Legacy value format is only supported by passing a string. * * @example * import { define as $, RichPresence } from '@cruncheevos/core' * * const format = RichPresence.format({ name: 'Score', type: 'VALUE' }) * format.at('0xcafe_v1') // '@Car(0xcafe_v1)' * format.at($(['Measured', 'Mem', 'Float', 0xCAFE])) // '@Car(fFcafe)' */ at(input: string | Condition | ConditionBuilder): string; }; Float1: { /** Name of this Rich Presence Format */ name: string; /** Type of this Rich Presence Format, such as SCORE, FRAMES, etc. */ type: RichPresence.Format; /** * Returns string representation of Rich Presence Format definition * * @example * import { RichPresence } from '@cruncheevos/core' * const format = RichPresence.format({ name: 'Score', type: 'VALUE' }) * format.toString() // 'Format:Score\nFormatType=VALUE' */ toString(): string; /** * Returns string representation of Rich PresenceFormat macro call * * If there's only one condition - output may be shortened. * * When passing Condition or ConditionBuilder - you must have * at least one condition marked as Measured. * * Legacy value format is only supported by passing a string. * * @example * import { define as $, RichPresence } from '@cruncheevos/core' * * const format = RichPresence.format({ name: 'Score', type: 'VALUE' }) * format.at('0xcafe_v1') // '@Car(0xcafe_v1)' * format.at($(['Measured', 'Mem', 'Float', 0xCAFE])) // '@Car(fFcafe)' */ at(input: string | Condition | ConditionBuilder): string; }; Float2: { /** Name of this Rich Presence Format */ name: string; /** Type of this Rich Presence Format, such as SCORE, FRAMES, etc. */ type: RichPresence.Format; /** * Returns string representation of Rich Presence Format definition * * @example * import { RichPresence } from '@cruncheevos/core' * const format = RichPresence.format({ name: 'Score', type: 'VALUE' }) * format.toString() // 'Format:Score\nFormatType=VALUE' */ toString(): string; /** * Returns string representation of Rich PresenceFormat macro call * * If there's only one condition - output may be shortened. * * When passing Condition or ConditionBuilder - you must have * at least one condition marked as Measured. * * Legacy value format is only supported by passing a string. * * @example * import { define as $, RichPresence } from '@cruncheevos/core' * * const format = RichPresence.format({ name: 'Score', type: 'VALUE' }) * format.at('0xcafe_v1') // '@Car(0xcafe_v1)' * format.at($(['Measured', 'Mem', 'Float', 0xCAFE])) // '@Car(fFcafe)' */ at(input: string | Condition | ConditionBuilder): string; }; Float3: { /** Name of this Rich Presence Format */ name: string; /** Type of this Rich Presence Format, such as SCORE, FRAMES, etc. */ type: RichPresence.Format; /** * Returns string representation of Rich Presence Format definition * * @example * import { RichPresence } from '@cruncheevos/core' * const format = RichPresence.format({ name: 'Score', type: 'VALUE' }) * format.toString() // 'Format:Score\nFormatType=VALUE' */ toString(): string; /** * Returns string representation of Rich PresenceFormat macro call * * If there's only one condition - output may be shortened. * * When passing Condition or ConditionBuilder - you must have * at least one condition marked as Measured. * * Legacy value format is only supported by passing a string. * * @example * import { define as $, RichPresence } from '@cruncheevos/core' * * const format = RichPresence.format({ name: 'Score', type: 'VALUE' }) * format.at('0xcafe_v1') // '@Car(0xcafe_v1)' * format.at($(['Measured', 'Mem', 'Float', 0xCAFE])) // '@Car(fFcafe)' */ at(input: string | Condition | ConditionBuilder): string; }; Float4: { /** Name of this Rich Presence Format */ name: string; /** Type of this Rich Presence Format, such as SCORE, FRAMES, etc. */ type: RichPresence.Format; /** * Returns string representation of Rich Presence Format definition * * @example * import { RichPresence } from '@cruncheevos/core' * const format = RichPresence.format({ name: 'Score', type: 'VALUE' }) * format.toString() // 'Format:Score\nFormatType=VALUE' */ toString(): string; /** * Returns string representation of Rich PresenceFormat macro call * * If there's only one condition - output may be shortened. * * When passing Condition or ConditionBuilder - you must have * at least one condition marked as Measured. * * Legacy value format is only supported by passing a string. * * @example * import { define as $, RichPresence } from '@cruncheevos/core' * * const format = RichPresence.format({ name: 'Score', type: 'VALUE' }) * format.at('0xcafe_v1') // '@Car(0xcafe_v1)' * format.at($(['Measured', 'Mem', 'Float', 0xCAFE])) // '@Car(fFcafe)' */ at(input: string | Condition | ConditionBuilder): string; }; Float5: { /** Name of this Rich Presence Format */ name: string; /** Type of this Rich Presence Format, such as SCORE, FRAMES, etc. */ type: RichPresence.Format; /** * Returns string representation of Rich Presence Format definition * * @example * import { RichPresence } from '@cruncheevos/core' * const format = RichPresence.format({ name: 'Score', type: 'VALUE' }) * format.toString() // 'Format:Score\nFormatType=VALUE' */ toString(): string; /** * Returns string representation of Rich PresenceFormat macro call * * If there's only one condition - output may be shortened. * * When passing Condition or ConditionBuilder - you must have * at least one condition marked as Measured. * * Legacy value format is only supported by passing a string. * * @example * import { define as $, RichPresence } from '@cruncheevos/core' * * const format = RichPresence.format({ name: 'Score', type: 'VALUE' }) * format.at('0xcafe_v1') // '@Car(0xcafe_v1)' * format.at($(['Measured', 'Mem', 'Float', 0xCAFE])) // '@Car(fFcafe)' */ at(input: string | Condition | ConditionBuilder): string; }; Float6: { /** Name of this Rich Presence Format */ name: string; /** Type of this Rich Presence Format, such as SCORE, FRAMES, etc. */ type: RichPresence.Format; /** * Returns string representation of Rich Presence Format definition * * @example * import { RichPresence } from '@cruncheevos/core' * const format = RichPresence.format({ name: 'Score', type: 'VALUE' }) * format.toString() // 'Format:Score\nFormatType=VALUE' */ toString(): string; /** * Returns string representation of Rich PresenceFormat macro call * * If there's only one condition - output may be shortened. * * When passing Condition or ConditionBuilder - you must have * at least one condition marked as Measured. * * Legacy value format is only supported by passing a string. * * @example * import { define as $, RichPresence } from '@cruncheevos/core' * * const format = RichPresence.format({ name: 'Score', type: 'VALUE' }) * format.at('0xcafe_v1') // '@Car(0xcafe_v1)' * format.at($(['Measured', 'Mem', 'Float', 0xCAFE])) // '@Car(fFcafe)' */ at(input: string | Condition | ConditionBuilder): string; }; ASCIIChar: { /** Name of this Rich Presence Format */ name: string; /** Type of this Rich Presence Format, such as SCORE, FRAMES, etc. */ type: RichPresence.Format; /** * Returns string representation of Rich Presence Format definition * * @example * import { RichPresence } from '@cruncheevos/core' * const format = RichPresence.format({ name: 'Score', type: 'VALUE' }) * format.toString() // 'Format:Score\nFormatType=VALUE' */ toString(): string; /** * Returns string representation of Rich PresenceFormat macro call * * If there's only one condition - output may be shortened. * * When passing Condition or ConditionBuilder - you must have * at least one condition marked as Measured. * * Legacy value format is only supported by passing a string. * * @example * import { define as $, RichPresence } from '@cruncheevos/core' * * const format = RichPresence.format({ name: 'Score', type: 'VALUE' }) * format.at('0xcafe_v1') // '@Car(0xcafe_v1)' * format.at($(['Measured', 'Mem', 'Float', 0xCAFE])) // '@Car(fFcafe)' */ at(input: string | Condition | ConditionBuilder): string; }; UnicodeChar: { /** Name of this Rich Presence Format */ name: string; /** Type of this Rich Presence Format, such as SCORE, FRAMES, etc. */ type: RichPresence.Format; /** * Returns string representation of Rich Presence Format definition * * @example * import { RichPresence } from '@cruncheevos/core' * const format = RichPresence.format({ name: 'Score', type: 'VALUE' }) * format.toString() // 'Format:Score\nFormatType=VALUE' */ toString(): string; /** * Returns string representation of Rich PresenceFormat macro call * * If there's only one condition - output may be shortened. * * When passing Condition or ConditionBuilder - you must have * at least one condition marked as Measured. * * Legacy value format is only supported by passing a string. * * @example * import { define as $, RichPresence } from '@cruncheevos/core' * * const format = RichPresence.format({ name: 'Score', type: 'VALUE' }) * format.at('0xcafe_v1') // '@Car(0xcafe_v1)' * format.at($(['Measured', 'Mem', 'Float', 0xCAFE])) // '@Car(fFcafe)' */ at(input: string | Condition | ConditionBuilder): string; }; }; toString(): string; }; /** * Returns a string representing Rich Presence Display line * * Does not check if provided arguments are of correct type * * @example * import { RichPresence } from '@cruncheevos/core' * RichPresence.display('0=1', 'Nothing is happening')) * // '?0=1?Nothing is happening' */ display: typeof makeRichPresenceDisplay; /** * Creates an object representing Rich Presence Format * * @example * import { RichPresence } from '@cruncheevos/core' * * const format = RichPresence.format({ * name: 'Score', * type: 'VALUE', * }) * * format.at('0xCAFE_v1') // '@Score(0xCAFE_v1)' * format.at($(['Measured', 'Mem', '16bit', 0xCAFE])) // '@Score(0xcafe)' * format.toString() // 'Format:Score\nFormatType=VALUE' */ format: typeof makeRichPresenceFormat; /** * Creates an object representing Rich Presence Lookup * * @example * import { RichPresence } from '@cruncheevos/core' * * const lookup = RichPresence.lookup({ * name: 'Car', * keyFormat: 'hex', * values: { * 1: 'First!', * 2: 'Second!', * 4: 'Same', * 5: 'Same', * }, * defaultAt: 0xfeed, * compressRanges: true * }) * * lookup.at() // '@Car(0xfeed)' * lookup.at('0xCAFE_v1') // '@Score(0xCAFE_v1)' * lookup.at($(['Measured', 'Mem', 'Float', 0xCAFE])) // '@Car(fFcafe)' * lookup.toString() // `Lookup:Car\n0x1=First!\n0x2=Second!\n0x4-0x5=Same' */ lookup: typeof makeRichPresenceLookup; /** * Tagged template literal function which can accept Rich Presence Lookup instances. * This allows for less noisy display strings. * * @example * import { RichPresence } from '@cruncheevos/core' * * const lookup = RichPresence.lookup({ name: 'Song', defaultAddress: 0xfeed, values: { ... } }) * * RichPresence.tag`${lookup} - now playing` // '@Song(0xfeed) - now playing' */ tag: typeof taggedDisplayString; /** * Provides an object containing default Rich Presence Macros * * @example * import { RichPresence } from '@cruncheevos/core' * * RichPresence.macro.Score.at('0xCAFE') // '@Score(0xCAFE)' * RichPresence.macro.ASCIIChar.at('0xCAFE') // '@ASCIIChar(0xCAFE)' */ macro: { Number: { /** Name of this Rich Presence Format */ name: string; /** Type of this Rich Presence Format, such as SCORE, FRAMES, etc. */ type: RichPresence.Format; /** * Returns string representation of Rich Presence Format definition * * @example * import { RichPresence } from '@cruncheevos/core' * const format = RichPresence.format({ name: 'Score', type: 'VALUE' }) * format.toString() // 'Format:Score\nFormatType=VALUE' */ toString(): string; /** * Returns string representation of Rich PresenceFormat macro call * * If there's only one condition - output may be shortened. * * When passing Condition or ConditionBuilder - you must have * at least one condition marked as Measured. * * Legacy value format is only supported by passing a string. * * @example * import { define as $, RichPresence } from '@cruncheevos/core' * * const format = RichPresence.format({ name: 'Score', type: 'VALUE' }) * format.at('0xcafe_v1') // '@Car(0xcafe_v1)' * format.at($(['Measured', 'Mem', 'Float', 0xCAFE])) // '@Car(fFcafe)' */ at(input: string | Condition | ConditionBuilder): string; }; Unsigned: { /** Name of this Rich Presence Format */ name: string; /** Type of this Rich Presence Format, such as SCORE, FRAMES, etc. */ type: RichPresence.Format; /** * Returns string representation of Rich Presence Format definition * * @example * import { RichPresence } from '@cruncheevos/core' * const format = RichPresence.format({ name: 'Score', type: 'VALUE' }) * format.toString() // 'Format:Score\nFormatType=VALUE' */ toString(): string; /** * Returns string representation of Rich PresenceFormat macro call * * If there's only one condition - output may be shortened. * * When passing Condition or ConditionBuilder - you must have * at least one condition marked as Measured. * * Legacy value format is only supported by passing a string. * * @example * import { define as $, RichPresence } from '@cruncheevos/core' * * const format = RichPresence.format({ name: 'Score', type: 'VALUE' }) * format.at('0xcafe_v1') // '@Car(0xcafe_v1)' * format.at($(['Measured', 'Mem', 'Float', 0xCAFE])) // '@Car(fFcafe)' */ at(input: string | Condition | ConditionBuilder): string; }; Score: { /** Name of this Rich Presence Format */ name: string; /** Type of this Rich Presence Format, such as SCORE, FRAMES, etc. */ type: RichPresence.Format; /** * Returns string representation of Rich Presence Format definition * * @example * import { RichPresence } from '@cruncheevos/core' * const format = RichPresence.format({ name: 'Score', type: 'VALUE' }) * format.toString() // 'Format:Score\nFormatType=VALUE' */ toString(): string; /** * Returns string representation of Rich PresenceFormat macro call * * If there's only one condition - output may be shortened. * * When passing Condition or ConditionBuilder - you must have * at least one condition marked as Measured. * * Legacy value format is only supported by passing a string. * * @example * import { define as $, RichPresence } from '@cruncheevos/core' * * const format = RichPresence.format({ name: 'Score', type: 'VALUE' }) * format.at('0xcafe_v1') // '@Car(0xcafe_v1)' * format.at($(['Measured', 'Mem', 'Float', 0xCAFE])) // '@Car(fFcafe)' */ at(input: string | Condition | ConditionBuilder): string; }; Centiseconds: { /** Name of this Rich Presence Format */ name: string; /** Type of this Rich Presence Format, such as SCORE, FRAMES, etc. */ type: RichPresence.Format; /** * Returns string representation of Rich Presence Format definition * * @example * import { RichPresence } from '@cruncheevos/core' * const format = RichPresence.format({ name: 'Score', type: 'VALUE' }) * format.toString() // 'Format:Score\nFormatType=VALUE' */ toString(): string; /** * Returns string representation of Rich PresenceFormat macro call * * If there's only one condition - output may be shortened. * * When passing Condition or ConditionBuilder - you must have * at least one condition marked as Measured. * * Legacy value format is only supported by passing a string. * * @example * import { define as $, RichPresence } from '@cruncheevos/core' * * const format = RichPresence.format({ name: 'Score', type: 'VALUE' }) * format.at('0xcafe_v1') // '@Car(0xcafe_v1)' * format.at($(['Measured', 'Mem', 'Float', 0xCAFE])) // '@Car(fFcafe)' */ at(input: string | Condition | ConditionBuilder): string; }; Seconds: { /** Name of this Rich Presence Format */ name: string; /** Type of this Rich Presence Format, such as SCORE, FRAMES, etc.