@yongdall/types 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.mts +5 -1
- package/index.mjs +5 -0
- package/index.mjs.map +1 -1
- package/package.json +1 -1
package/index.d.mts
CHANGED
|
@@ -264,5 +264,9 @@ type Permission = {
|
|
|
264
264
|
organizationField?: string | undefined;
|
|
265
265
|
};
|
|
266
266
|
type MaybePromise<T> = PromiseLike<T> | T;
|
|
267
|
+
type Permissions = {
|
|
268
|
+
has: (permission: string) => boolean;
|
|
269
|
+
size: number;
|
|
270
|
+
};
|
|
267
271
|
//#endregion
|
|
268
|
-
export { Field, MaybePromise, Permission, Tenant };
|
|
272
|
+
export { Field, MaybePromise, Permission, Permissions, Tenant };
|
package/index.mjs
CHANGED
|
@@ -96,6 +96,11 @@ const Field = {};
|
|
|
96
96
|
* @template T
|
|
97
97
|
* @typedef {PromiseLike<T> | T} MaybePromise
|
|
98
98
|
*/
|
|
99
|
+
/**
|
|
100
|
+
* @typedef {object} Permissions
|
|
101
|
+
* @property {(permission: string) => boolean} has
|
|
102
|
+
* @property {number} size
|
|
103
|
+
*/
|
|
99
104
|
|
|
100
105
|
//#endregion
|
|
101
106
|
export { Field };
|
package/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../packages/types/Field.mjs","../../packages/types/index.mjs"],"sourcesContent":["\n/**\n * @typedef {Object} Field.Layout.Column\n * @property {string[]} [actions] 操作\n * @property {string} [action] 操作\n * @property {string} [field] 字段\n * @property {number} [placeholder] 占位符\n * @property {string} [pattern] 模式\n * @property {number} [width] 宽度\n * @property {string} [label] 标签\n */\n/**\n * @typedef {Object} Field.Layout\n * @property {number} [colSpan] 占用列数\n * @property {number} [colStart] 列起点\n * @property {number} [colEnd] 列终点\n * @property {number} [rowSpan] 占用行数\n * @property {number} [rowStart] 行起点\n * @property {number} [rowEnd] 行终点\n * @property {string} [levelKey]\n * @property {number} [head]\n * @property {boolean} [hidden]\n * @property {Field.Layout.Column[]} [columns]\n */\n/**\n * @typedef {Object} Field\n * @property {string | Record<string, Field>} type 字段的基本类型\n * @property {boolean} [nullable] 是否可为空\n * @property {any} [default] 默认值\n * @property {({component: string; [k: string]: any} | string)[] | {component: string; [k: string]: any} | string} [renderer]\n * @property {boolean} [array] \n * \n * @property {number} [scale] 缩放比\n * @property {number} [primary] 是否为主键\n * @property {boolean} [uncreatable] 是否为可创建值\n * @property {boolean} [immutable] 是否为固定值\n * @property {number} [sort] 排序顺序,绝对值表示在排序列表中的顺序,负数表示逆序排序, 0 表示不排序\n * \n * @property {string} [group] 权限配置\n * \n * @property {Field.Layout} [layout] 行终点\n * \n * @property {number} [layoutOrder]\n * \n * \n * @property {string} [model]\n * \n * @property {(string | [string, object])[] | null} [scripts]\n * \n * @property {boolean} [readonly]\n * @property {boolean} [required]\n * @property {boolean} [clearable]\n * @property {boolean} [disabled]\n * \n * @property {string?} [label]\n * @property {string?} [description]\n * @property {string?} [placeholder]\n * @property {number?} [step]\n * @property {number?} [max]\n * @property {number?} [min]\n * \n * \n * \n * \n * \n * @property {string} [options]\n * \n * @property {boolean} [quick]\n * @property {boolean} [translatable]\n * \n * @property {boolean} [ignorePermissions]\n * @property {boolean} [noCopy]\n */\n\nexport const Field = {\n\t\n}\n","export * from './Field.mjs'\n/**\n * @typedef {Object} Tenant\n * @property {string} id - 租户的唯一标识符。\n * @property {string} label - 租户的名称。\n * @property {boolean} single - 指示该租户是否为单实例模式。\n * @property {Object.<string, string>} providers - 包含提供商名称及其对应值的键值对记录。\n * @property {Uint8Array<ArrayBuffer> | string} salt 加密盐\n */\n\n/**\n * @typedef {object} Permission 模型权限定义\n * @property {string} [permission] - 关联到的权限信息\n * @property {string | string[]} [group] - 字段分组\n * @property {string | string[]} [fields] - 字段\n * @property {Record<string, {value?: unknown; values?: unknown[]; user?: boolean}>} [constraints] - 字段信息约束\n * @property {string[] | Set<string>} [authorizations] - 授权列表\n * @property {string} [organizationField] - 可选,组织类型字段,其值为模型的组织类型字段,如果设置此项,则表示用户需要在文档此字段所示组织内由上述权限,此规则才生效\n */\n\n/**\n * @template T\n * @typedef {PromiseLike<T> | T} MaybePromise\n */\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0EA,MAAa,QAAQ,EAEpB"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../packages/types/Field.mjs","../../packages/types/index.mjs"],"sourcesContent":["\n/**\n * @typedef {Object} Field.Layout.Column\n * @property {string[]} [actions] 操作\n * @property {string} [action] 操作\n * @property {string} [field] 字段\n * @property {number} [placeholder] 占位符\n * @property {string} [pattern] 模式\n * @property {number} [width] 宽度\n * @property {string} [label] 标签\n */\n/**\n * @typedef {Object} Field.Layout\n * @property {number} [colSpan] 占用列数\n * @property {number} [colStart] 列起点\n * @property {number} [colEnd] 列终点\n * @property {number} [rowSpan] 占用行数\n * @property {number} [rowStart] 行起点\n * @property {number} [rowEnd] 行终点\n * @property {string} [levelKey]\n * @property {number} [head]\n * @property {boolean} [hidden]\n * @property {Field.Layout.Column[]} [columns]\n */\n/**\n * @typedef {Object} Field\n * @property {string | Record<string, Field>} type 字段的基本类型\n * @property {boolean} [nullable] 是否可为空\n * @property {any} [default] 默认值\n * @property {({component: string; [k: string]: any} | string)[] | {component: string; [k: string]: any} | string} [renderer]\n * @property {boolean} [array] \n * \n * @property {number} [scale] 缩放比\n * @property {number} [primary] 是否为主键\n * @property {boolean} [uncreatable] 是否为可创建值\n * @property {boolean} [immutable] 是否为固定值\n * @property {number} [sort] 排序顺序,绝对值表示在排序列表中的顺序,负数表示逆序排序, 0 表示不排序\n * \n * @property {string} [group] 权限配置\n * \n * @property {Field.Layout} [layout] 行终点\n * \n * @property {number} [layoutOrder]\n * \n * \n * @property {string} [model]\n * \n * @property {(string | [string, object])[] | null} [scripts]\n * \n * @property {boolean} [readonly]\n * @property {boolean} [required]\n * @property {boolean} [clearable]\n * @property {boolean} [disabled]\n * \n * @property {string?} [label]\n * @property {string?} [description]\n * @property {string?} [placeholder]\n * @property {number?} [step]\n * @property {number?} [max]\n * @property {number?} [min]\n * \n * \n * \n * \n * \n * @property {string} [options]\n * \n * @property {boolean} [quick]\n * @property {boolean} [translatable]\n * \n * @property {boolean} [ignorePermissions]\n * @property {boolean} [noCopy]\n */\n\nexport const Field = {\n\t\n}\n","export * from './Field.mjs'\n/**\n * @typedef {Object} Tenant\n * @property {string} id - 租户的唯一标识符。\n * @property {string} label - 租户的名称。\n * @property {boolean} single - 指示该租户是否为单实例模式。\n * @property {Object.<string, string>} providers - 包含提供商名称及其对应值的键值对记录。\n * @property {Uint8Array<ArrayBuffer> | string} salt 加密盐\n */\n\n/**\n * @typedef {object} Permission 模型权限定义\n * @property {string} [permission] - 关联到的权限信息\n * @property {string | string[]} [group] - 字段分组\n * @property {string | string[]} [fields] - 字段\n * @property {Record<string, {value?: unknown; values?: unknown[]; user?: boolean}>} [constraints] - 字段信息约束\n * @property {string[] | Set<string>} [authorizations] - 授权列表\n * @property {string} [organizationField] - 可选,组织类型字段,其值为模型的组织类型字段,如果设置此项,则表示用户需要在文档此字段所示组织内由上述权限,此规则才生效\n */\n\n/**\n * @template T\n * @typedef {PromiseLike<T> | T} MaybePromise\n */\n\n/**\n * @typedef {object} Permissions\n * @property {(permission: string) => boolean} has\n * @property {number} size\n */\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0EA,MAAa,QAAQ,EAEpB"}
|