This repository has been archived on 2026-04-03. You can view files and clone it, but cannot push or open issues or pull requests.
Nico e2667f8e12 Initial nyx project — fork of hermes-frontend
Forked from hermes-frontend, stripped openclaw/bun specifics:
- Auth tokens: openclaw_session -> nyx_session
- Vite proxy: localhost:3003 -> localhost:8000 (assay)
- Prod WS: wss://assay.loop42.de/ws
- Workspace paths: removed openclaw-specific paths
- Added missing deps: @heroicons/vue, overlayscrollbars-vue
- Branding: title -> nyx

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 20:23:27 +02:00

51 lines
2.0 KiB
TypeScript

import { ParseResult, ParserPlugin } from "@babel/parser";
import { File, Function, Identifier, Node, VariableDeclaration } from "@babel/types";
//#region src/types.d.ts
interface ParseOptions {
filename?: string;
parserPlugins?: ParserPlugin[];
}
type Scope = Record<string, Node>;
interface WalkerContext {
skip: () => void;
remove: () => void;
replace: (node: Node) => void;
}
interface ScopeContext {
parent: Node | undefined | null;
key: string | undefined | null;
index: number | undefined | null;
scope: Scope;
scopes: Scope[];
level: number;
}
interface WalkerHooks {
enter?: (this: WalkerContext & ScopeContext, node: Node) => void;
enterAfter?: (this: ScopeContext, node: Node) => void;
leave?: (this: WalkerContext & ScopeContext, node: Node) => void;
leaveAfter?: (this: ScopeContext, node: Node) => void;
}
//#endregion
//#region src/utils/babel.d.ts
declare const isNewScope: (node: Node | undefined | null) => boolean;
declare function walkFunctionParams(node: Function, onIdent: (id: Identifier) => void): void;
declare function extractIdentifiers(param: Node, nodes?: Identifier[]): Identifier[];
declare function babelParse(code: string, filename?: string, parserPlugins?: ParserPlugin[]): ParseResult<File>;
declare function walkVariableDeclaration(stmt: VariableDeclaration, register: (id: Identifier) => void): void;
declare function walkNewIdentifier(node: Node, register: (id: Identifier) => void): void;
//#endregion
//#region src/index.d.ts
declare function walk(code: string, walkHooks: WalkerHooks, {
filename,
parserPlugins
}?: ParseOptions): ParseResult<File>;
declare function walkAST(node: Node | Node[], {
enter,
leave,
enterAfter,
leaveAfter
}: WalkerHooks): void;
declare function getRootScope(nodes: Node[]): Scope;
//#endregion
export { ParseOptions, Scope, ScopeContext, WalkerContext, WalkerHooks, babelParse, extractIdentifiers, getRootScope, isNewScope, walk, walkAST, walkFunctionParams, walkNewIdentifier, walkVariableDeclaration };