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

@choiceform/interface-data-types

v0.1.1

Published

Type definitions and data structures for Interface project

Downloads

198

Readme

@choiceform/interface-data-types

Interface 项目的核心类型定义和数据结构包。

简介

这个包提供了 Interface 项目中使用的所有 TypeScript 类型定义和数据结构,包括页面、组件、节点、样式、交互等核心概念的类型定义。

安装

pnpm add @choiceform/interface-data-types

主要模块

基础类型 (base)

  • IndexKey: 分数索引键类型
  • StopLike: 渐变停止点类型
  • AttrNumericValue: 数值属性类型

文件与页面 (file, page)

  • FileId: 文件标识符
  • Page: 页面数据结构
  • PageType: 页面类型(page | folder)
  • BreakPointItem: 断点配置

组件 (component)

  • ComponentId: 组件标识符
  • RawComponent: 组件数据结构

节点 (node)

  • NodeId: 节点标识符
  • NodeType: 节点类型(FrameNode, RichTextNode, ComponentNode 等)
  • LayoutType: 布局类型(stack | grid)
  • 节点属性:交互、链接、动效、页面效果、形状、样式、文本内容等

样式 (color, font, paint, style)

  • RGB, RGBA: 颜色类型
  • 字体相关类型
  • 绘制相关类型
  • 样式相关类型

交互与条件 (condition, variable)

  • 条件判断类型
  • 变量类型

预览 (preview)

  • PreviewData: 预览数据结构
  • PreviewPageItem: 预览页面项
  • PreviewNode: 预览节点

站点 (site)

  • SiteAttrs: 站点属性
  • PageSiteAttrs: 页面站点属性
  • SiteState: 站点状态
  • SiteLanguage: 站点语言

工具类型 (util, math, code)

  • 数学工具类型(BoxLike, PointLike 等)
  • 代码相关类型
  • 通用工具类型

使用示例

import type { Page, ComponentId, NodeType, PreviewData } from "@choiceform/interface-data-types"

// 使用页面类型
const page: Page = {
  fileId: "file-123",
  id: "page-123",
  parentId: null,
  index: "a0",
  name: "/home",
  type: "page",
  siteAttrs: {
    title: "Home",
    description: "Home page",
    language: "zh",
  },
  createdAt: Date.now(),
  updatedAt: null,
}

// 使用节点类型
const nodeType: NodeType = "FrameNode"

// 使用预览数据类型
const previewData: PreviewData = {
  pages: {},
  mode: "page",
  activePath: "/home",
}

开发

构建

pnpm build

开发模式(监听模式)

pnpm dev

检查循环依赖

pnpm check:circular

清理构建产物

pnpm clean

发布

包会在发布前自动执行清理和构建:

pnpm prepublishOnly

License

MIT