/* tslint:disable */ /* eslint-disable */ /** * *Renders that patterns on a hexagonal grid * * @param {GridOptions} grid_options Options for drawing the patterns * @param {PatternVariantArray} patterns List of patterns * @param {number} max_width This is the width of the hexagonal grid before patterns are wrapped around * @param {number} scale Distance between points on the grid (in pixels) * @returns {Uint8Array} PNG of the image as a byte array */ export function draw_hex_grid(grid_options: GridOptions, patterns: PatternVariantArray, max_width: number, scale: number): Uint8Array; /** * *Renders that patterns on a hexagonal grid that fits in a given resolution * * @param {GridOptions} grid_options Options for drawing the patterns * @param {PatternVariantArray} patterns List of patterns * @param {number} max_width This is the width of the hexagonal grid before patterns are wrapped around * @param {number} width Maximum width of output image * @param {number} height Maximum height of output image * @returns {Uint8Array} PNG of the image as a byte array */ export function draw_bound_hex_grid(grid_options: GridOptions, patterns: PatternVariantArray, max_width: number, width: number, height: number): Uint8Array; /** * *Renders that patterns on a square tile grid *Every pattern is 1 tile * * @param {GridOptions} grid_options Options for drawing the patterns * @param {PatternVariantArray} patterns List of patterns * @param {number} max_width Maximum number of tiles per row * @param {number} max_scale Maximum size for patterns (Percentage) * @param {number} x_pad Padding between tiles in the x direction (Percentage) * @param {number} y_pad Padding between tiles in the y direction (Percentage) * @param {number} scale Size of each tile (in pixels) * @returns {Uint8Array} PNG of the image as a byte array */ export function draw_square_grid(grid_options: GridOptions, patterns: PatternVariantArray, max_width: number, max_scale: number, x_pad: number, y_pad: number, scale: number): Uint8Array; /** * *Renders that patterns on a square tile grid that fits in the given resolution *Every pattern is 1 tile * * @param {GridOptions} grid_options Options for drawing the patterns * @param {PatternVariantArray} patterns List of patterns * @param {number} max_width Maximum number of tiles per row * @param {number} max_scale Maximum size for patterns (Percentage) * @param {number} x_pad Padding between tiles in the x direction (Percentage) * @param {number} y_pad Padding between tiles in the y direction (Percentage) * @param {number} width Maximum width of output image * @param {number} height Maximum height of output image * @returns {Uint8Array} PNG of the image as a byte array */ export function draw_bound_square_grid(grid_options: GridOptions, patterns: PatternVariantArray, max_width: number, max_scale: number, x_pad: number, y_pad: number, width: number, height: number): Uint8Array; /** * *Renders a single pattern bound to a certain image size. *Almost equivalent to draw_bound_square_grid, however, it draws the pattern without padding for the segment renderer arrows. *This allows for single patterns to not change in size if the renderer is all that changes. * * @param {GridOptions} grid_options Options for drawing the patterns * @param {PatternVariant} pattern Pattern to draw * @param {number} max_scale Maximum size for the pattern (percentage) * @param {number} width Maximum width of the output image * @param {number} height Maximum height of the output image * */ export function draw_bound_pattern(grid_options: GridOptions, pattern: PatternVariant, max_scale: number, width: number, height: number): Uint8Array; export type Color = [number, number, number, number]; export type Lines = { type: "Monocolor"; color: Color; bent: boolean } | { type: "Gradient"; colors: Color[]; segments_per_color: number; bent: boolean } | { type: "SegmentColors"; colors: Color[]; triangles: Triangle; collisions: CollisionOption }; export type Triangle = { type: "None" } | { type: "Match"; radius: number } | { type: "BorderMatch"; match_radius: number; border: Marker } | { type: "BorderStartMatch"; match_radius: number; border: Marker }; export type CollisionOption = { type: "Dashes"; color: Color } | { type: "MatchedDashes" } | { type: "ParallelLines" } | { type: "OverloadedParallel"; max_line: number; overload: OverloadOptions }; export type OverloadOptions = { type: "Dashes"; color: Color } | { type: "LabeledDashes"; color: Color; label: Marker } | { type: "MatchedDashes" }; export type Point = { type: "None" } | { type: "Single"; marker: Marker } | { type: "Double"; inner: Marker; outer: Marker }; export interface Marker { color: Color; radius: number; } export type EndPoint = { type: "Point"; point: Point } | { type: "Match"; radius: number } | { type: "BorderedMatch"; match_radius: number; border: Marker }; export type Intersections = { type: "Nothing" } | { type: "UniformPoints"; point: Point } | { type: "EndsAndMiddle"; start: EndPoint; end: EndPoint; middle: Point }; export type GridPatternOptions = { type: "Uniform"; intersections: Intersections; lines: Lines } | { type: "Changing"; variations: [Intersections, Lines][]; intros: string[]; retros: string[] }; export interface GridOptions { line_thickness: number; pattern_options: GridPatternOptions; center_dot: Point; } export interface PatternVariant { direction: string; angle_sigs: string; great_spell: boolean; } export type PatternVariantArray = PatternVariant[]; export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module; export interface InitOutput { readonly memory: WebAssembly.Memory; readonly draw_hex_grid: (a: number, b: number, c: number, d: number, e: number) => void; readonly draw_bound_hex_grid: (a: number, b: number, c: number, d: number, e: number, f: number) => void; readonly draw_square_grid: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void; readonly draw_bound_square_grid: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void; readonly draw_bound_pattern: (a: number, b: number, c: number, d: number, e: number, f: number) => void; readonly __wbindgen_malloc: (a: number, b: number) => number; readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; readonly __wbindgen_add_to_stack_pointer: (a: number) => number; readonly __wbindgen_free: (a: number, b: number, c: number) => void; readonly __wbindgen_exn_store: (a: number) => void; } export type SyncInitInput = BufferSource | WebAssembly.Module; /** * Instantiates the given `module`, which can either be bytes or * a precompiled `WebAssembly.Module`. * * @param {SyncInitInput} module * * @returns {InitOutput} */ export function initSync(module: SyncInitInput): InitOutput; /** * If `module_or_path` is {RequestInfo} or {URL}, makes a request and * for everything else, calls `WebAssembly.instantiate` directly. * * @param {InitInput | Promise} module_or_path * * @returns {Promise} */ export default function __wbg_init (module_or_path?: InitInput | Promise): Promise;