···11// This file is auto-generated by @hey-api/openapi-ts
2233+export type ClientOptions = {
44+ baseUrl: 'https://petstore3.swagger.io/api/v3' | (string & {})
55+}
66+37export type Order = {
48 complete?: boolean
59 id?: number
···687691 */
688692 200: unknown
689693}
690690-691691-export type ClientOptions = {
692692- baseUrl: 'https://petstore3.swagger.io/api/v3' | (string & {})
693693-}
+1-1
packages/codegen-core/src/files/file.ts
···141141 * Syntax nodes contained in this file.
142142 */
143143 get nodes(): ReadonlyArray<INode> {
144144- return this._nodes;
144144+ return [...this._nodes];
145145 }
146146147147 /**
+15-13
packages/codegen-core/src/nodes/registry.ts
···11+import { fromRef, ref } from '../refs/refs';
22+import type { Ref } from '../refs/types';
13import type { INode } from './node';
24import type { INodeRegistry } from './types';
3546export class NodeRegistry implements INodeRegistry {
55- private brands: Map<string, Array<INode>> = new Map();
66- private list: Array<INode> = [];
77+ private list: Array<Ref<INode | null>> = [];
7888- add(node: INode): void {
99- this.list.push(node);
99+ add(node: INode | null): number {
1010+ const index = this.list.push(ref(node));
1111+ return index - 1;
1212+ }
10131111- let group = this.brands.get(node['~brand']);
1212- if (!group) {
1313- group = [];
1414- this.brands.set(node['~brand'], group);
1414+ *all(): Iterable<INode> {
1515+ for (const r of this.list) {
1616+ const node = fromRef(r);
1717+ if (node) yield node;
1518 }
1616- group.push(node);
1719 }
18201919- all(): ReadonlyArray<INode> {
2020- return this.list;
2121+ remove(index: number): void {
2222+ this.list[index] = ref(null);
2123 }
22242323- byBrand(brand: string): ReadonlyArray<INode> {
2424- return this.brands.get(brand) ?? [];
2525+ update(index: number, node: INode | null): void {
2626+ this.list[index] = ref(node);
2527 }
2628}
+15-4
packages/codegen-core/src/nodes/types.d.ts
···33export interface INodeRegistry {
44 /**
55 * Register a syntax node.
66+ *
77+ * @returns The index of the registered node.
68 */
77- add(node: INode): void;
99+ add(node: INode | null): number;
810 /**
911 * All nodes in insertion order.
1012 */
1111- all(): ReadonlyArray<INode>;
1313+ all(): Iterable<INode>;
1414+ /**
1515+ * Remove a node by its index.
1616+ *
1717+ * @param index Index of the node to remove.
1818+ */
1919+ remove(index: number): void;
1220 /**
1313- * Nodes by backend brand, so planner doesn't need to filter repeatedly.
2121+ * Update a node at the given index.
2222+ *
2323+ * @param index Index of the node to update.
2424+ * @param node New node to set.
1425 */
1515- byBrand(brand: string): ReadonlyArray<INode>;
2626+ update(index: number, node: INode | null): void;
1627}
···11// This file is auto-generated by @hey-api/openapi-ts
2233-export type Foo = unknown;
44-53export type ClientOptions = {
64 baseUrl: `${string}://${string}` | (string & {});
75};
66+77+export type Foo = unknown;
···11// This file is auto-generated by @hey-api/openapi-ts
2233-export type Foo = unknown;
44-53export type ClientOptions = {
64 baseUrl: `${string}://${string}` | (string & {});
75};
66+77+export type Foo = unknown;