UNPKG

@nocobase/flow-engine

Version:

A standalone flow engine for NocoBase, managing workflows, models, and actions.

46 lines (45 loc) 1.49 kB
/** * This file is part of the NocoBase (R) project. * Copyright (c) 2020-2024 NocoBase Co., Ltd. * Authors: NocoBase Team. * * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License. * For more information, please refer to: https://www.nocobase.com/agreement. */ import { FlowEngineContext } from '../flowContext'; interface ViewParam { /** 视图唯一标识符,一般为某个 Model 实例的 uid */ viewUid?: string; /** 标签页唯一标识符 */ tabUid?: string; /** 弹窗记录的 id */ filterByTk?: string; /** source Id */ sourceId?: string; } /** * 将 ViewParam 数组转换为 pathname * * @param viewParams - ViewParam 数组 * @returns 生成的 pathname * * @example * ```typescript * generatePathnameFromViewParams([{ viewUid: 'xxx' }]) // '/admin/xxx' * generatePathnameFromViewParams([{ viewUid: 'xxx', tabUid: 'yyy' }]) // '/admin/xxx/tab/yyy' * generatePathnameFromViewParams([{ viewUid: 'xxx' }, { viewUid: 'yyy' }]) // '/admin/xxx/view/yyy' * ``` */ export declare function generatePathnameFromViewParams(viewParams: ViewParam[]): string; export declare class ViewNavigation { viewStack: ViewParam[]; ctx: FlowEngineContext; constructor(ctx: FlowEngineContext, viewParams: ViewParam[]); changeTo(viewParam: ViewParam): void; navigateTo(viewParam: ViewParam, opts?: { replace?: boolean; state?: any; }): Promise<void>; back(): void; } export {};