Files
n8n_Demo/backups/exhibition-demo-backup-20250928-210916/node_modules/unist-util-is/lib/index.d.ts
Yep_Q 67f5dfbe50 feat: 实现多订单班支持系统
主要功能:
- 修改RequirementModal支持12个订单班选择
- 添加OrderClassIconMap图标映射组件
- Store中添加selectedOrderClass状态管理
- WorkflowPage支持传递orderClass参数
- web_result添加URL参数切换功能
- 创建order-class-handler.js动态处理页面主题

技术改进:
- 创建软链接关联订单班数据目录
- 生成wenlu.json和food.json数据结构
- 删除重复的web_result目录
- 添加测试页面test-order-class.html

影响范围:
- 展会策划系统现支持12个订单班
- 结果展示页面自动适配不同订单班主题
- 用户可选择不同行业生成对应方案

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-29 10:02:15 +08:00

197 lines
5.5 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* @typedef {import('unist').Node} Node
* @typedef {import('unist').Parent} Parent
*/
/**
* @template Fn
* @template Fallback
* @typedef {Fn extends (value: any) => value is infer Thing ? Thing : Fallback} Predicate
*/
/**
* @callback Check
* Check that an arbitrary value is a node.
* @param {unknown} this
* The given context.
* @param {unknown} [node]
* Anything (typically a node).
* @param {number | null | undefined} [index]
* The nodes position in its parent.
* @param {Parent | null | undefined} [parent]
* The nodes parent.
* @returns {boolean}
* Whether this is a node and passes a test.
*
* @typedef {Record<string, unknown> | Node} Props
* Object to check for equivalence.
*
* Note: `Node` is included as it is common but is not indexable.
*
* @typedef {Array<Props | TestFunction | string> | Props | TestFunction | string | null | undefined} Test
* Check for an arbitrary node.
*
* @callback TestFunction
* Check if a node passes a test.
* @param {unknown} this
* The given context.
* @param {Node} node
* A node.
* @param {number | undefined} [index]
* The nodes position in its parent.
* @param {Parent | undefined} [parent]
* The nodes parent.
* @returns {boolean | undefined | void}
* Whether this node passes the test.
*
* Note: `void` is included until TS sees no return as `undefined`.
*/
/**
* Check if `node` is a `Node` and whether it passes the given test.
*
* @param {unknown} node
* Thing to check, typically `Node`.
* @param {Test} test
* A check for a specific node.
* @param {number | null | undefined} index
* The nodes position in its parent.
* @param {Parent | null | undefined} parent
* The nodes parent.
* @param {unknown} context
* Context object (`this`) to pass to `test` functions.
* @returns {boolean}
* Whether `node` is a node and passes a test.
*/
export const is: (<Condition extends string>(
node: unknown,
test: Condition,
index?: number | null | undefined,
parent?: Parent | null | undefined,
context?: unknown
) => node is import('unist').Node & {
type: Condition
}) &
(<Condition_1 extends Props>(
node: unknown,
test: Condition_1,
index?: number | null | undefined,
parent?: Parent | null | undefined,
context?: unknown
) => node is import('unist').Node & Condition_1) &
(<Condition_2 extends TestFunction>(
node: unknown,
test: Condition_2,
index?: number | null | undefined,
parent?: Parent | null | undefined,
context?: unknown
) => node is import('unist').Node &
Predicate<Condition_2, import('unist').Node>) &
((node?: null | undefined) => false) &
((
node: unknown,
test?: null | undefined,
index?: number | null | undefined,
parent?: Parent | null | undefined,
context?: unknown
) => node is import('unist').Node) &
((
node: unknown,
test?: Test,
index?: number | null | undefined,
parent?: Parent | null | undefined,
context?: unknown
) => boolean)
/**
* Generate an assertion from a test.
*
* Useful if youre going to test many nodes, for example when creating a
* utility where something else passes a compatible test.
*
* The created function is a bit faster because it expects valid input only:
* a `node`, `index`, and `parent`.
*
* @param {Test} test
* * when nullish, checks if `node` is a `Node`.
* * when `string`, works like passing `(node) => node.type === test`.
* * when `function` checks if function passed the node is true.
* * when `object`, checks that all keys in test are in node, and that they have (strictly) equal values.
* * when `array`, checks if any one of the subtests pass.
* @returns {Check}
* An assertion.
*/
export const convert: (<Condition extends string>(
test: Condition
) => (
node: unknown,
index?: number | null | undefined,
parent?: Parent | null | undefined,
context?: unknown
) => node is import('unist').Node & {
type: Condition
}) &
(<Condition_1 extends Props>(
test: Condition_1
) => (
node: unknown,
index?: number | null | undefined,
parent?: Parent | null | undefined,
context?: unknown
) => node is import('unist').Node & Condition_1) &
(<Condition_2 extends TestFunction>(
test: Condition_2
) => (
node: unknown,
index?: number | null | undefined,
parent?: Parent | null | undefined,
context?: unknown
) => node is import('unist').Node &
Predicate<Condition_2, import('unist').Node>) &
((
test?: null | undefined
) => (
node?: unknown,
index?: number | null | undefined,
parent?: Parent | null | undefined,
context?: unknown
) => node is import('unist').Node) &
((test?: Test) => Check)
export type Node = import('unist').Node
export type Parent = import('unist').Parent
export type Predicate<Fn, Fallback> = Fn extends (
value: any
) => value is infer Thing
? Thing
: Fallback
/**
* Check that an arbitrary value is a node.
*/
export type Check = (
this: unknown,
node?: unknown,
index?: number | null | undefined,
parent?: Parent | null | undefined
) => boolean
/**
* Object to check for equivalence.
*
* Note: `Node` is included as it is common but is not indexable.
*/
export type Props = Record<string, unknown> | Node
/**
* Check for an arbitrary node.
*/
export type Test =
| Array<Props | TestFunction | string>
| Props
| TestFunction
| string
| null
| undefined
/**
* Check if a node passes a test.
*/
export type TestFunction = (
this: unknown,
node: Node,
index?: number | undefined,
parent?: Parent | undefined
) => boolean | undefined | void