Skip to content

Commit

Permalink
Update types
Browse files Browse the repository at this point in the history
  • Loading branch information
hlysine committed Feb 1, 2025
1 parent bd920af commit d58ec11
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions packages/logic-core/assets/logic-core.global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ declare global {
readonly x: number;
readonly y: number;
constructor(x: number, y: number);
abstract validateSymbol(grid: GridData): State;
abstract validateSymbol(grid: GridData, solution: GridData | null): State;
modeVariant(_mode: Mode): Symbol$1 | null;
onGridResize(
_grid: GridData,
Expand Down Expand Up @@ -521,15 +521,21 @@ declare global {
{
readonly controlLines: readonly ControlLine[];
readonly track: GridData | null;
readonly normalizeVelocity: boolean;
private static readonly EXAMPLE_GRID;
private static readonly CONFIGS;
private static readonly SEARCH_VARIANTS;
/**
* **Music Grid: Listen to the solution**
* @param controlLines Denote changes in the playback settings. At least one control line at column 0 should be present to enable playback.
* @param track The grid to be played when "listen" is clicked. Set as null to play the solution.
* @param normalizeVelocity Whether to normalize the velocity of the notes by their pitch such that lower notes are played softer.
*/
constructor(controlLines: readonly ControlLine[], track: GridData | null);
constructor(
controlLines: readonly ControlLine[],
track: GridData | null,
normalizeVelocity?: boolean
);
get id(): string;
get explanation(): string;
get configs(): readonly AnyConfig[] | null;
Expand Down Expand Up @@ -558,9 +564,11 @@ declare global {
copyWith({
controlLines,
track,
normalizeVelocity,
}: {
controlLines?: readonly ControlLine[];
track?: GridData | null;
normalizeVelocity?: boolean;
}): this;
get validateWithSolution(): boolean;
get isSingleton(): boolean;
Expand Down Expand Up @@ -1194,12 +1202,14 @@ declare global {
* Controls whether a symbol should be visible in the grid.
*
* @param grid The grid that is being displayed.
* @param solution The solution grid, if it is available.
* @param symbol The symbol that is being displayed.
* @param editing Whether the grid is being edited.
* @returns True if the symbol should be displayed, false otherwise. The symbol will not be displayed if any handler returns false.
*/
onSymbolDisplay(
grid: GridData,
solution: GridData | null,
symbol: Symbol$1,
editing: boolean
): boolean;
Expand Down Expand Up @@ -6028,7 +6038,6 @@ declare global {
{
readonly x: number;
readonly y: number;
readonly color: Color;
readonly revealLocation: boolean;
private static readonly CONFIGS;
private static readonly EXAMPLE_GRID;
Expand All @@ -6037,35 +6046,32 @@ declare global {
*
* @param x - The x-coordinate of the symbol.
* @param y - The y-coordinate of the symbol.
* @param color - The target color of the cell.
* @param revealLocation - Whether to reveal the location of the symbol.
*/
constructor(x: number, y: number, color: Color, revealLocation?: boolean);
constructor(x: number, y: number, revealLocation?: boolean);
get id(): string;
get explanation(): string;
get configs(): readonly AnyConfig[] | null;
createExampleGrid(): GridData;
get necessaryForCompletion(): boolean;
get visibleWhenSolving(): boolean;
get sortOrder(): number;
validateSymbol(grid: GridData): State;
validateSymbol(grid: GridData, solution: GridData | null): State;
onSymbolDisplay(
grid: GridData,
solution: GridData | null,
symbol: Symbol$1,
editing: boolean
): boolean;
copyWith({
x,
y,
color,
revealLocation,
}: {
x?: number;
y?: number;
color?: Color;
revealLocation?: boolean;
}): this;
withColor(color: Color): this;
withRevealLocation(revealLocation: boolean): this;
}
export declare const allSymbols: Map<string, Symbol$1>;
Expand Down

0 comments on commit d58ec11

Please sign in to comment.