This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Accessor, createEffect, createMemo, Resource } from 'solid-js' | |
| export function check< | |
| T, | |
| const TAccessor extends Accessor<T> | T, | |
| const TValues extends TAccessor extends ((...args: any[]) => any) | undefined | |
| ? Exclude<ReturnType<Exclude<TAccessor, undefined>>, null | undefined | false> | |
| : Exclude<TAccessor, null | undefined | false>, | |
| const TResult, | |
| >(accessor: TAccessor, callback: (value: TValues) => TResult): TResult | undefined |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Monaco } from '@monaco-editor/loader' | |
| const regex = { | |
| import: | |
| /import\s+(?:type\s+)?(?:\{[^}]*\}|\* as [^\s]+|\w+\s*,\s*\{[^}]*\}|\w+)?\s+from\s*"(.+?)";?/gs, | |
| export: | |
| /export\s+(?:\{[^}]*\}|\* as [^\s]+|\*|\w+(?:,\s*\{[^}]*\})?|type \{[^}]*\})?\s+from\s*"(.+?)";?/gs, | |
| require: /require\s*\(["']([^"']+)["']\)/g, | |
| } | |
| export class TypeRegistry { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * array extended with mutable/in-place array-methods | |
| */ | |
| class ArrayInPlace<T = number> extends Array { | |
| commands: Command<T>[] = []; | |
| constructor(values: T[]) { | |
| super(); | |
| Array.prototype.push.apply(this, values); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ArrayInPlace<T = number> extends Array { | |
| commands: Command<T>[] = []; | |
| constructor(values: T[]) { | |
| super(); | |
| for (let i = 0; i < Math.floor(values.length / 100_000); i++) { | |
| Array.prototype.push.apply( | |
| this, | |
| values.slice(i * 100_000, (i + 1) * 100_000), | |
| ); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import ts from 'typescript' | |
| type Accessor<T> = () => T | |
| const tsModules: Record<string, { content: string; version: number }> = {} | |
| function modifyImportPaths(code: string) { | |
| return code.replace(/import ([^"']+) from ["']([^"']+)["']/g, (match, varName, path) => { | |
| if (path.startsWith('blob:') || path.startsWith('http:') || path.startsWith('https:') || path.startsWith('.')) { | |
| return `import ${varName} from "${path}"` | |
| } else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { | |
| onCleanup, | |
| createMemo, | |
| createSignal, | |
| type Accessor, | |
| createEffect, | |
| createResource, | |
| } from "solid-js"; | |
| function modifyImportPaths(code) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const genPadding = (layer: number) => | |
| new Array(layer).fill(" ").flat().join(""); | |
| function genObject({object}: any, layer: number) { | |
| const entries = Object.entries(object); | |
| let result = "{\n"; | |
| const padding = genPadding(layer); | |
| for (const [key, value] of entries) { | |
| result += padding; | |
| result += `${key}: ${valibotToTs(value, layer + 1)},\n`; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Accessor } from 'solid-js' | |
| export function when< | |
| TAccessors extends Array<Accessor<any>>, | |
| const TValues extends { [TKey in keyof TAccessors]: Exclude<ReturnType<TAccessors[TKey]>, null | undefined | false> } | |
| >(...accessors: TAccessors) { | |
| function callback<const TResult>(): TValues | undefined | |
| function callback<const TResult>(callback: (...values: TValues) => TResult): TResult | undefined | |
| function callback<const TResult>(callback?: (...values: TValues) => TResult) { | |
| const values = new Array(accessors.length) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Vector } from '@ndbx/types'; | |
| import { MouseEvent as MouseEventReact } from 'react'; | |
| /** | |
| * cursor | |
| * | |
| * @param e MouseEvent | |
| * @param callback called every onMouseMove | |
| * @returns Promise resolved onMouseUp | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Generated by dts-bundle v0.7.3 | |
| // Dependencies for this module: | |
| // ../solid-js/jsx-runtime | |
| // ../three | |
| // ../utility-types | |
| // ../solid-js | |
| // ../solid-js/store | |
| declare module 'solid-three' { | |
| import * as ReactThreeFiber from 'solid-three/three-types'; |