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

@arkmp/types

v0.2.1

Published

Readme

@arkmp/types

对外发布包

ArkMP 源码侧(.ets)全局类型声明:以 ambient .d.ts 模拟 ArkUI 全局 DSL 命名空间,为源码提供类型提示,无运行时产物。

所属层

L6 source-side(独立子树)。

依赖

无外部依赖(package.json 仅含构建/测试用 devDependencies:tsdtypescript)。本包仅发布单个 index.d.ts,不含任何可执行代码,无构建步骤。

导出 API

本包不含 import/export,全部为全局 ambient 声明,覆盖以下几类:

装饰器(08 篇装饰器白名单,共 14 个)

@Entry(支持 { routeName? } 参数)、@Component@Observed@State@Prop@Link@Provide@Consume@ObjectLink@Builder@Styles@Extend(component)@Watch(propName)@StorageLink(key)

枚举

对齐与取值类枚举:FlexAlignHorizontalAlignVerticalAlignAlignmentVisibilityImageFitToggleTypeFontWeightFontStyleTextAlignTextOverflowColor(常用颜色常量,值为 CSS 颜色字符串)。

资源与基础值类型

  • $r(value): ArkResource$rawfile(value): ArkResource:引用应用资源(media/color/string/rawfile)。
  • ArkLengthnumber | string,number 按 vp 处理)、ArkColorArkEdgeInsetsArkPositionArkOffsetArkConstraintSizeArkBorderOptionsArkShadowOptionsArkLinearGradientOptionsArkScaleOptionsArkRotateOptions

事件类型

ArkClickEventArkTouchEvent(用于 onClick/onTouch 回调签名)。

链式修饰符与组件

  • ArkCommonAttribute<Self>:公共流式修饰符(尺寸/间距/背景边框/文本/渲染/定位变换/布局/事件),链式调用保持具体类型。
  • 布局容器:ColumnRowStackFlexScrollList/ListItemGrid/GridItemSwiperTabs/TabContent,各自有 *Attribute*Options
  • 基础组件:TextImageButtonTextInputTextAreaToggleCheckboxRadioSliderProgressLoadingProgressDividerBlankBadgeWebVideoCanvas

控制流

ForEach<T>(items, itemGenerator, keyGenerator?):数组渲染(编译为 wx:for)。

路由 API

router 命名空间:push/replace/back/pop(result?)/switchTab/relaunch(编译为 wx.navigateTo/wx.redirectTo/wx.navigateBack/eventChannel.emit/wx.switchTab/wx.reLaunch)。

用法示例

// 本包为 ambient 声明,引入方式见 @arkmp/api;此处展示被声明的数据结构形态。
// ArkLength:number 按 vp,字符串透传
const w: ArkLength = 100;          // → 100vp → 编译期 ×2 换算为 200rpx
const full: ArkLength = '100%';    // 字符串透传

// 颜色:Color 枚举或 CSS 颜色字符串
const c: ArkColor = Color.Red;     // '#ff0000'
const custom: ArkColor = '#112233';

// 边距:单值或四方向对象
const m1 = 8;                       // number 单值
const m2: ArkEdgeInsets = { top: 4, left: 8 };

// 资源引用
const logo: ArkResource = $r('app.media.logo');

测试

pnpm --filter @arkmp/types test