···11export type { Graph, NodeInfo } from './types/graph';
22export type {
33 GetPointerPriorityFn,
44- PointerGroupMatch,
44+ MatchPointerToGroupFn,
55 WalkOptions,
66} from './types/walk';
77export { walk } from './walk';
+9-4
packages/openapi-ts/src/graph/types/walk.d.ts
···4455export type GetPointerPriorityFn = (pointer: string) => number;
6677-export type PointerGroupMatch<T extends string = string> =
77+export type MatchPointerToGroupFn<T extends string = string> = (
88+ pointer: string,
99+ kind?: T,
1010+) => PointerGroupMatch<T>;
1111+1212+type PointerGroupMatch<T extends string = string> =
813 | { kind: T; matched: true }
914 | { kind?: undefined; matched: false };
1015···2126 * @param pointer The pointer string
2227 * @returns The group name, or undefined if no match
2328 */
2424- matchPointerToGroup?: (pointer: string) => PointerGroupMatch<T>;
2929+ matchPointerToGroup?: MatchPointerToGroupFn<T>;
2530 /**
2631 * Order of walking schemas.
2732 *
···4752 preferGroups?: ReadonlyArray<T>;
4853};
49545050-export type WalkFn = (
5555+export type WalkFn = <T extends string = string>(
5156 graph: Graph,
5257 callback: WalkCallbackFn,
5353- options?: WalkOptions,
5858+ options?: WalkOptions<T>,
5459) => void;
+5-5
packages/openapi-ts/src/ir/graph.ts
···11-import type { GetPointerPriorityFn, PointerGroupMatch } from '~/graph';
11+import type { GetPointerPriorityFn, MatchPointerToGroupFn } from '~/graph';
2233export const irTopLevelKinds = [
44 'operation',
···1818 * @param kind - (Optional) The component kind to check
1919 * @returns { matched: true, kind: IrTopLevelKind } | { matched: false } - Whether it matched, and the matched kind if so
2020 */
2121-export const matchIrPointerToGroup = (
2222- pointer: string,
2323- kind?: IrTopLevelKind,
2424-): PointerGroupMatch<IrTopLevelKind> => {
2121+export const matchIrPointerToGroup: MatchPointerToGroupFn<IrTopLevelKind> = (
2222+ pointer,
2323+ kind,
2424+) => {
2525 const patterns: Record<IrTopLevelKind, RegExp> = {
2626 operation:
2727 /^#\/paths\/[^/]+\/(get|put|post|delete|options|head|patch|trace)$/,