npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@coding-flow/flow-types

v0.0.7

Published

flow-engine types

Readme

@coding-flow/flow-types

Flow Engine 前端 TypeScript 类型定义库,提供流程实例、表单、审批等业务类型定义。

简介

flow-types 是 Flow Engine 的类型定义库,为整个前端项目提供统一的业务类型系统。

依赖关系

  • 依赖: @coding-flow/flow-core

Setup

安装依赖:

pnpm install

开发

构建库:

pnpm run build

监听模式构建:

pnpm run dev

核心类型

流程定义类型

  • Workflow - 工作流定义
  • WorkflowMeta - 工作流元数据

节点类型

  • FlowNode - 节点基础类型
  • NodeType - 节点类型枚举
  • 节点具体类型:StartNode, EndNode, ApprovalNode, HandleNode, NotifyNode, RouterNode, SubProcessNode, DelayNode, TriggerNode, ConditionNode, ParallelNode, InclusiveNode

策略类型

  • NodeStrategy - 节点策略基础类型
  • WorkflowStrategy - 工作流策略类型
  • 策略具体类型:MultiOperatorAuditStrategy, TimeoutStrategy

动作类型

  • FlowAction - 动作基础类型
  • ActionType - 动作类型枚举
  • 动作具体类型:PassAction, RejectAction, SaveAction, AddAuditAction, DelegateAction, ReturnAction, TransferAction, CustomAction

表单类型

  • FlowForm - 表单定义
  • FormField - 表单字段定义
  • FormFieldPermission - 字段权限类型

记录类型

  • FlowRecord - 流程记录类型
  • FlowState - 流程状态枚举
  • RecordState - 记录状态枚举

审批类型

  • ApprovalTask - 审批任务
  • ApprovalResult - 审批结果

类型系统特点

层次化节点结构

使用 blocks 属性实现节点间的层次关系:

interface FlowNode {
  id: string;
  name: string;
  type: NodeType;
  blocks?: FlowNode[];  // 子节点列表(块节点包含子节点)
  strategies?: NodeStrategy[];
  actions?: FlowAction[];
}

节点分类

  • 基础节点 (9 种): START, END, APPROVAL, HANDLE, NOTIFY, ROUTER, SUB_PROCESS, DELAY, TRIGGER
  • 块节点 (3 种): CONDITION, PARALLEL, INCLUSIVE(包含子节点)
  • 分支节点 (3 种): CONDITION_BRANCH, PARALLEL_BRANCH, INCLUSIVE_BRANCH

使用示例

import type { Workflow, FlowNode, NodeType } from '@coding-flow/flow-types';

// 定义一个工作流
const workflow: Workflow = {
  id: 'wf-001',
  name: '请假审批流程',
  nodes: [
    {
      id: 'start-1',
      name: '开始',
      type: 'START' as NodeType
    },
    {
      id: 'approval-1',
      name: '经理审批',
      type: 'APPROVAL' as NodeType,
      strategies: [...],
      actions: [...]
    }
  ]
};

Learn more