@lytjs/plugin-logger 4.1.0 → 5.0.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/README.md ADDED
@@ -0,0 +1,135 @@
1
+ # @lytjs/plugin-logger
2
+
3
+ > Lyt.js 日志插件 - 提供分级日志记录、日志过滤和持久化存储功能
4
+
5
+ **版本:** 4.2.0
6
+
7
+ ## 安装
8
+
9
+ ```bash
10
+ npm install @lytjs/plugin-logger
11
+ ```
12
+
13
+ ## 使用
14
+
15
+ ### 注册插件
16
+
17
+ ```typescript
18
+ import { createApp } from '@lytjs/core'
19
+ import { createLogger } from '@lytjs/plugin-logger'
20
+
21
+ const logger = createLogger({
22
+ level: 'debug',
23
+ prefix: '[Lyt]',
24
+ persist: true,
25
+ maxLogs: 1000,
26
+ })
27
+
28
+ const app = createApp({})
29
+ app.use(logger)
30
+ ```
31
+
32
+ ### 基本日志输出
33
+
34
+ ```typescript
35
+ logger.debug('调试信息', { foo: 'bar' })
36
+ logger.info('普通信息')
37
+ logger.warn('警告信息')
38
+ logger.error('错误信息', new Error('出错了'))
39
+ ```
40
+
41
+ ### 动态调整日志级别
42
+
43
+ ```typescript
44
+ // 开发环境使用 debug
45
+ logger.setLevel('debug')
46
+
47
+ // 生产环境使用 warn
48
+ logger.setLevel('warn')
49
+
50
+ // 关闭所有日志
51
+ logger.setLevel('silent')
52
+
53
+ // 获取当前级别
54
+ logger.getLevel() // 'warn'
55
+ ```
56
+
57
+ ### 自定义传输
58
+
59
+ ```typescript
60
+ const logger = createLogger({
61
+ level: 'info',
62
+ transport: (log) => {
63
+ // 发送日志到远程服务器
64
+ fetch('/api/logs', {
65
+ method: 'POST',
66
+ body: JSON.stringify(log),
67
+ })
68
+ },
69
+ })
70
+ ```
71
+
72
+ ### 获取和清除日志
73
+
74
+ ```typescript
75
+ // 获取所有日志记录
76
+ const logs = logger.getLogs()
77
+
78
+ // 清除日志记录
79
+ logger.clearLogs()
80
+
81
+ // 销毁日志实例,释放资源
82
+ logger.destroy()
83
+ ```
84
+
85
+ ## API
86
+
87
+ ### Options
88
+
89
+ | 选项 | 类型 | 默认值 | 描述 |
90
+ |------|------|--------|------|
91
+ | `level` | `'debug' \| 'info' \| 'warn' \| 'error' \| 'silent'` | `'info'` | 日志级别 |
92
+ | `prefix` | `string` | `''` | 日志前缀 |
93
+ | `persist` | `boolean` | `false` | 是否持久化到 localStorage |
94
+ | `maxLogs` | `number` | `1000` | 最大日志条数(FIFO 策略) |
95
+ | `timestamp` | `boolean` | `true` | 是否显示时间戳 |
96
+ | `format` | `string` | - | 自定义格式化模板,例如 `'{timestamp} [{level}] {prefix} {message}'` |
97
+ | `transport` | `(log: LogEntry) => void` | - | 自定义日志传输(如发送到服务器) |
98
+
99
+ ### 方法
100
+
101
+ | 方法 | 签名 | 描述 |
102
+ |------|------|------|
103
+ | `debug` | `(...args: any[]) => void` | 输出调试日志 |
104
+ | `info` | `(...args: any[]) => void` | 输出信息日志 |
105
+ | `warn` | `(...args: any[]) => void` | 输出警告日志 |
106
+ | `error` | `(...args: any[]) => void` | 输出错误日志 |
107
+ | `setLevel` | `(level: LogLevel) => void` | 设置日志级别 |
108
+ | `getLevel` | `() => LogLevel` | 获取当前日志级别 |
109
+ | `getLogs` | `() => LogEntry[]` | 获取所有日志记录 |
110
+ | `clearLogs` | `() => void` | 清除日志记录 |
111
+ | `destroy` | `() => void` | 销毁日志实例,释放资源 |
112
+
113
+ ### 类型
114
+
115
+ ```typescript
116
+ type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'silent'
117
+
118
+ interface LogEntry {
119
+ level: LogLevel
120
+ message: string
121
+ timestamp: number
122
+ args: any[]
123
+ }
124
+ ```
125
+
126
+ ### 特性
127
+
128
+ - **彩色输出**:浏览器环境使用 CSS 样式,Node.js 环境使用 ANSI 颜色码
129
+ - **持久化**:支持将日志存储到 localStorage,页面刷新后可恢复
130
+ - **FIFO 策略**:超过 `maxLogs` 时自动丢弃最早的日志
131
+ - **自定义格式**:通过 `format` 选项自定义日志输出格式
132
+
133
+ ## License
134
+
135
+ MIT
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- var d=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var $=Object.getOwnPropertyNames;var _=Object.prototype.hasOwnProperty;var R=(o,r)=>{for(var n in r)d(o,n,{get:r[n],enumerable:!0})},k=(o,r,n,g)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of $(r))!_.call(o,i)&&i!==n&&d(o,i,{get:()=>r[i],enumerable:!(g=I(r,i))||g.enumerable});return o};var N=o=>k(d({},"__esModule",{value:!0}),o);var T={};R(T,{createLogger:()=>J});module.exports=N(T);var b={debug:0,info:1,warn:2,error:3,silent:4},l={reset:"\x1B[0m",gray:"\x1B[90m",blue:"\x1B[36m",yellow:"\x1B[33m",red:"\x1B[31m",bold:"\x1B[1m"},c="lyt_logger_logs";function O(o){return new Date(o).toISOString()}function P(o){return o.map(r=>{if(r===null)return"null";if(r===void 0)return"undefined";if(typeof r=="string")return r;if(typeof r=="number"||typeof r=="boolean")return String(r);if(r instanceof Error)return`${r.message}
2
- ${r.stack||""}`;try{return JSON.stringify(r,null,2)}catch(n){return String(r)}}).join(" ")}function C(o){switch(o){case"debug":return l.gray;case"info":return l.blue;case"warn":return l.yellow;case"error":return l.red;default:return l.reset}}function E(o){return o.toUpperCase().padEnd(5)}function J(o){let{level:r="info",prefix:n="",persist:g=!1,maxLogs:i=1e3,timestamp:v=!0,format:m,transport:p}=o||{},u=r,t=[],y=!1;if(g)try{let e=localStorage.getItem(c);e&&(t=JSON.parse(e))}catch(e){t=[]}function h(){if(g)try{localStorage.setItem(c,JSON.stringify(t))}catch(e){}}function w(e){if(m)return m.replace("{timestamp}",v?O(e.timestamp):"").replace("{level}",E(e.level)).replace("{prefix}",n).replace("{message}",e.message);let s=[];return v&&s.push(O(e.timestamp)),n&&s.push(n),s.push(`${E(e.level)} ${e.message}`),s.join(" ")}function a(e,s){if(y||b[e]<b[u])return;let L={level:e,message:P(s),timestamp:Date.now(),args:[...s]};t.push(L),t.length>i&&(t=t.slice(t.length-i)),h();let S=C(e),x=w(L),j=`${S}${x}${l.reset}`;switch(e){case"debug":break;case"info":break;case"warn":break;case"error":break}if(p)try{p(L)}catch(A){}}let f={install(e,s){e.config=e.config||{},e.config.globalProperties=e.config.globalProperties||{},e.config.globalProperties.$logger=f,typeof e.provide=="function"&&e.provide("logger",f)},debug(...e){a("debug",e)},info(...e){a("info",e)},warn(...e){a("warn",e)},error(...e){a("error",e)},setLevel(e){u=e},getLevel(){return u},getLogs(){return[...t]},clearLogs(){if(t=[],g)try{localStorage.removeItem(c)}catch(e){}},destroy(){if(y=!0,t=[],g)try{localStorage.removeItem(c)}catch(e){}}};return f}
1
+ "use strict";var L=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var C=Object.prototype.hasOwnProperty;var P=(o,r)=>{for(var n in r)L(o,n,{get:r[n],enumerable:!0})},A=(o,r,n,g)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of _(r))!C.call(o,s)&&s!==n&&L(o,s,{get:()=>r[s],enumerable:!(g=R(r,s))||g.enumerable});return o};var N=o=>A(L({},"__esModule",{value:!0}),o);var D={};P(D,{createLogger:()=>j});module.exports=N(D);var w={debug:0,info:1,warn:2,error:3,silent:4},h={reset:"\x1B[0m",gray:"\x1B[90m",blue:"\x1B[36m",yellow:"\x1B[33m",red:"\x1B[31m",bold:"\x1B[1m"},E={reset:"",gray:"color: gray",blue:"color: #00bcd4",yellow:"color: #ff9800",red:"color: #f44336",bold:"font-weight: bold"},k=typeof window!="undefined",a="lyt_logger_logs";function S(o){return new Date(o).toISOString()}function J(o){return o.map(r=>{if(r===null)return"null";if(r===void 0)return"undefined";if(typeof r=="string")return r;if(typeof r=="number"||typeof r=="boolean")return String(r);if(r instanceof Error)return`${r.message}
2
+ ${r.stack||""}`;try{return JSON.stringify(r,null,2)}catch(n){return String(r)}}).join(" ")}function T(o){let r=k?E:h;switch(o){case"debug":return r.gray;case"info":return r.blue;case"warn":return r.yellow;case"error":return r.red;default:return r.reset}}function O(o){return o.toUpperCase().padEnd(5)}function j(o){let{level:r="info",prefix:n="",persist:g=!1,maxLogs:s=1e3,timestamp:m=!0,format:p,transport:y}=o||{},c=r,t=[],v=!1;if(g)try{let e=localStorage.getItem(a);e&&(t=JSON.parse(e))}catch(e){t=[]}function x(){if(g)try{localStorage.setItem(a,JSON.stringify(t))}catch(e){}}function $(e){if(p)return p.replace("{timestamp}",m?S(e.timestamp):"").replace("{level}",O(e.level)).replace("{prefix}",n).replace("{message}",e.message);let i=[];return m&&i.push(S(e.timestamp)),n&&i.push(n),i.push(`${O(e.level)} ${e.message}`),i.join(" ")}function l(e,i){if(v||w[e]<w[c])return;let f={level:e,message:J(i),timestamp:Date.now(),args:[...i]};t.push(f),t.length>s&&(t=t.slice(t.length-s)),x();let b=T(e),I=$(f);if(k){let d=E.reset,G=b||d;switch(e){case"debug":break;case"info":break;case"warn":break;case"error":break}}else{let d=`${b}${I}${h.reset}`;switch(e){case"debug":break;case"info":break;case"warn":break;case"error":break}}if(y)try{y(f)}catch(d){}}let u={install(e,i){e.config=e.config||{},e.config.globalProperties=e.config.globalProperties||{},e.config.globalProperties.$logger=u,typeof e.provide=="function"&&e.provide("logger",u)},debug(...e){l("debug",e)},info(...e){l("info",e)},warn(...e){l("warn",e)},error(...e){l("error",e)},setLevel(e){c=e},getLevel(){return c},getLogs(){return[...t]},clearLogs(){if(t=[],g)try{localStorage.removeItem(a)}catch(e){}},destroy(){if(v=!0,t=[],g)try{localStorage.removeItem(a)}catch(e){}}};return u}
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- var y={debug:0,info:1,warn:2,error:3,silent:4},i={reset:"\x1B[0m",gray:"\x1B[90m",blue:"\x1B[36m",yellow:"\x1B[33m",red:"\x1B[31m",bold:"\x1B[1m"},a="lyt_logger_logs";function b(t){return new Date(t).toISOString()}function x(t){return t.map(r=>{if(r===null)return"null";if(r===void 0)return"undefined";if(typeof r=="string")return r;if(typeof r=="number"||typeof r=="boolean")return String(r);if(r instanceof Error)return`${r.message}
2
- ${r.stack||""}`;try{return JSON.stringify(r,null,2)}catch(s){return String(r)}}).join(" ")}function I(t){switch(t){case"debug":return i.gray;case"info":return i.blue;case"warn":return i.yellow;case"error":return i.red;default:return i.reset}}function O(t){return t.toUpperCase().padEnd(5)}function R(t){let{level:r="info",prefix:s="",persist:g=!1,maxLogs:L=1e3,timestamp:d=!0,format:v,transport:m}=t||{},c=r,o=[],p=!1;if(g)try{let e=localStorage.getItem(a);e&&(o=JSON.parse(e))}catch(e){o=[]}function E(){if(g)try{localStorage.setItem(a,JSON.stringify(o))}catch(e){}}function h(e){if(v)return v.replace("{timestamp}",d?b(e.timestamp):"").replace("{level}",O(e.level)).replace("{prefix}",s).replace("{message}",e.message);let n=[];return d&&n.push(b(e.timestamp)),s&&n.push(s),n.push(`${O(e.level)} ${e.message}`),n.join(" ")}function l(e,n){if(p||y[e]<y[c])return;let f={level:e,message:x(n),timestamp:Date.now(),args:[...n]};o.push(f),o.length>L&&(o=o.slice(o.length-L)),E();let w=I(e),S=h(f),$=`${w}${S}${i.reset}`;switch(e){case"debug":break;case"info":break;case"warn":break;case"error":break}if(m)try{m(f)}catch(_){}}let u={install(e,n){e.config=e.config||{},e.config.globalProperties=e.config.globalProperties||{},e.config.globalProperties.$logger=u,typeof e.provide=="function"&&e.provide("logger",u)},debug(...e){l("debug",e)},info(...e){l("info",e)},warn(...e){l("warn",e)},error(...e){l("error",e)},setLevel(e){c=e},getLevel(){return c},getLogs(){return[...o]},clearLogs(){if(o=[],g)try{localStorage.removeItem(a)}catch(e){}},destroy(){if(p=!0,o=[],g)try{localStorage.removeItem(a)}catch(e){}}};return u}export{R as createLogger};
1
+ var b={debug:0,info:1,warn:2,error:3,silent:4},O={reset:"\x1B[0m",gray:"\x1B[90m",blue:"\x1B[36m",yellow:"\x1B[33m",red:"\x1B[31m",bold:"\x1B[1m"},h={reset:"",gray:"color: gray",blue:"color: #00bcd4",yellow:"color: #ff9800",red:"color: #f44336",bold:"font-weight: bold"},E=typeof window!="undefined",l="lyt_logger_logs";function w(t){return new Date(t).toISOString()}function I(t){return t.map(r=>{if(r===null)return"null";if(r===void 0)return"undefined";if(typeof r=="string")return r;if(typeof r=="number"||typeof r=="boolean")return String(r);if(r instanceof Error)return`${r.message}
2
+ ${r.stack||""}`;try{return JSON.stringify(r,null,2)}catch(s){return String(r)}}).join(" ")}function R(t){let r=E?h:O;switch(t){case"debug":return r.gray;case"info":return r.blue;case"warn":return r.yellow;case"error":return r.red;default:return r.reset}}function S(t){return t.toUpperCase().padEnd(5)}function C(t){let{level:r="info",prefix:s="",persist:i=!1,maxLogs:d=1e3,timestamp:L=!0,format:m,transport:p}=t||{},a=r,o=[],y=!1;if(i)try{let e=localStorage.getItem(l);e&&(o=JSON.parse(e))}catch(e){o=[]}function k(){if(i)try{localStorage.setItem(l,JSON.stringify(o))}catch(e){}}function x(e){if(m)return m.replace("{timestamp}",L?w(e.timestamp):"").replace("{level}",S(e.level)).replace("{prefix}",s).replace("{message}",e.message);let n=[];return L&&n.push(w(e.timestamp)),s&&n.push(s),n.push(`${S(e.level)} ${e.message}`),n.join(" ")}function g(e,n){if(y||b[e]<b[a])return;let u={level:e,message:I(n),timestamp:Date.now(),args:[...n]};o.push(u),o.length>d&&(o=o.slice(o.length-d)),k();let v=R(e),$=x(u);if(E){let f=h.reset,_=v||f;switch(e){case"debug":break;case"info":break;case"warn":break;case"error":break}}else{let f=`${v}${$}${O.reset}`;switch(e){case"debug":break;case"info":break;case"warn":break;case"error":break}}if(p)try{p(u)}catch(f){}}let c={install(e,n){e.config=e.config||{},e.config.globalProperties=e.config.globalProperties||{},e.config.globalProperties.$logger=c,typeof e.provide=="function"&&e.provide("logger",c)},debug(...e){g("debug",e)},info(...e){g("info",e)},warn(...e){g("warn",e)},error(...e){g("error",e)},setLevel(e){a=e},getLevel(){return a},getLogs(){return[...o]},clearLogs(){if(o=[],i)try{localStorage.removeItem(l)}catch(e){}},destroy(){if(y=!0,o=[],i)try{localStorage.removeItem(l)}catch(e){}}};return c}export{C as createLogger};
@@ -28,10 +28,15 @@ interface LogEntry {
28
28
  /** 附加参数 */
29
29
  args: any[];
30
30
  }
31
+ /** 日志插件应用接口(最小化) */
32
+ interface LoggerPluginApp {
33
+ use(plugin: unknown, options?: unknown): void;
34
+ [key: string]: unknown;
35
+ }
31
36
  /** 日志插件实例 */
32
37
  interface Logger {
33
38
  /** 安装到 Lyt 应用 */
34
- install: (app: any, options?: any) => void;
39
+ install: (app: LoggerPluginApp, options?: LoggerOptions) => void;
35
40
  /** 调试日志 */
36
41
  debug(...args: any[]): void;
37
42
  /** 信息日志 */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAkBA,WAAW;AACX,KAAK,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAA;AAE9D,eAAe;AACf,UAAU,aAAa;IACrB,qBAAqB;IACrB,KAAK,CAAC,EAAE,QAAQ,CAAA;IAChB,WAAW;IACX,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,mCAAmC;IACnC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,qBAAqB;IACrB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,sBAAsB;IACtB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,0DAA0D;IAC1D,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,uBAAuB;IACvB,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,QAAQ,KAAK,IAAI,CAAA;CACpC;AAED,WAAW;AACX,UAAU,QAAQ;IAChB,WAAW;IACX,KAAK,EAAE,QAAQ,CAAA;IACf,WAAW;IACX,OAAO,EAAE,MAAM,CAAA;IACf,cAAc;IACd,SAAS,EAAE,MAAM,CAAA;IAC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IACf,OAAO,IAAI,QAAQ,EAAE,CAAA;IACrB,aAAa;IACb,SAAS,IAAI,IAAI,CAAA;IACjB,aAAa;IACb,OAAO,IAAI,IAAI,CAAA;CAChB;AA0FD;;;;GAIG;AACH,iBAAS,YAAY,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,MAAM,CAoOrD;AAED,OAAO,EAAE,YAAY,EAAE,CAAA;AACvB,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lytjs/plugin-logger",
3
- "version": "4.1.0",
3
+ "version": "5.0.0",
4
4
  "description": "Lyt.js 日志插件 - 提供分级日志记录、日志过滤和持久化存储功能",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
@@ -1 +0,0 @@
1
- {"fileNames":["../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2022.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.dom.asynciterable.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.scripthost.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2022.array.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2022.error.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2022.object.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2022.string.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2022.full.d.ts","../src/index.ts"],"fileInfos":[{"version":"bcd24271a113971ba9eb71ff8cb01bc6b0f872a85c23fdbe5d93065b375933cd","signature":false,"affectsGlobalScope":true,"impliedFormat":1},{"version":"3f88bedbeb09c6f5a6645cb24c7c55f1aa22d19ae96c8e6959cbd8b85a707bc6","signature":false,"impliedFormat":1},{"version":"7fe93b39b810eadd916be8db880dd7f0f7012a5cc6ffb62de8f62a2117fa6f1f","signature":false,"impliedFormat":1},{"version":"bb0074cc08b84a2374af33d8bf044b80851ccc9e719a5e202eacf40db2c31600","signature":false,"impliedFormat":1},{"version":"1a7daebe4f45fb03d9ec53d60008fbf9ac45a697fdc89e4ce218bc94b94f94d6","signature":false,"impliedFormat":1},{"version":"f94b133a3cb14a288803be545ac2683e0d0ff6661bcd37e31aaaec54fc382aed","signature":false,"impliedFormat":1},{"version":"f59d0650799f8782fd74cf73c19223730c6d1b9198671b1c5b3a38e1188b5953","signature":false,"impliedFormat":1},{"version":"8a15b4607d9a499e2dbeed9ec0d3c0d7372c850b2d5f1fb259e8f6d41d468a84","signature":false,"impliedFormat":1},{"version":"26e0fe14baee4e127f4365d1ae0b276f400562e45e19e35fd2d4c296684715e6","signature":false,"impliedFormat":1},{"version":"d6b1eba8496bdd0eed6fc8a685768fe01b2da4a0388b5fe7df558290bffcf32f","signature":false,"affectsGlobalScope":true,"impliedFormat":1},{"version":"7f57fc4404ff020bc45b9c620aff2b40f700b95fe31164024c453a5e3c163c54","signature":false,"impliedFormat":1},{"version":"7f57fc4404ff020bc45b9c620aff2b40f700b95fe31164024c453a5e3c163c54","signature":false,"impliedFormat":1},{"version":"2a2de5b9459b3fc44decd9ce6100b72f1b002ef523126c1d3d8b2a4a63d74d78","signature":false,"affectsGlobalScope":true,"impliedFormat":1},{"version":"f13f4b465c99041e912db5c44129a94588e1aafee35a50eab51044833f50b4ee","signature":false,"affectsGlobalScope":true,"impliedFormat":1},{"version":"eadcffda2aa84802c73938e589b9e58248d74c59cb7fcbca6474e3435ac15504","signature":false,"affectsGlobalScope":true,"impliedFormat":1},{"version":"105ba8ff7ba746404fe1a2e189d1d3d2e0eb29a08c18dded791af02f29fb4711","signature":false,"affectsGlobalScope":true,"impliedFormat":1},{"version":"00343ca5b2e3d48fa5df1db6e32ea2a59afab09590274a6cccb1dbae82e60c7c","signature":false,"affectsGlobalScope":true,"impliedFormat":1},{"version":"ebd9f816d4002697cb2864bea1f0b70a103124e18a8cd9645eeccc09bdf80ab4","signature":false,"affectsGlobalScope":true,"impliedFormat":1},{"version":"2c1afac30a01772cd2a9a298a7ce7706b5892e447bb46bdbeef720f7b5da77ad","signature":false,"affectsGlobalScope":true,"impliedFormat":1},{"version":"7b0225f483e4fa685625ebe43dd584bb7973bbd84e66a6ba7bbe175ee1048b4f","signature":false,"affectsGlobalScope":true,"impliedFormat":1},{"version":"c0a4b8ac6ce74679c1da2b3795296f5896e31c38e888469a8e0f99dc3305de60","signature":false,"affectsGlobalScope":true,"impliedFormat":1},{"version":"3084a7b5f569088e0146533a00830e206565de65cae2239509168b11434cd84f","signature":false,"affectsGlobalScope":true,"impliedFormat":1},{"version":"c5079c53f0f141a0698faa903e76cb41cd664e3efb01cc17a5c46ec2eb0bef42","signature":false,"affectsGlobalScope":true,"impliedFormat":1},{"version":"32cafbc484dea6b0ab62cf8473182bbcb23020d70845b406f80b7526f38ae862","signature":false,"affectsGlobalScope":true,"impliedFormat":1},{"version":"fca4cdcb6d6c5ef18a869003d02c9f0fd95df8cfaf6eb431cd3376bc034cad36","signature":false,"affectsGlobalScope":true,"impliedFormat":1},{"version":"b93ec88115de9a9dc1b602291b85baf825c85666bf25985cc5f698073892b467","signature":false,"affectsGlobalScope":true,"impliedFormat":1},{"version":"f5c06dcc3fe849fcb297c247865a161f995cc29de7aa823afdd75aaaddc1419b","signature":false,"affectsGlobalScope":true,"impliedFormat":1},{"version":"b77e16112127a4b169ef0b8c3a4d730edf459c5f25fe52d5e436a6919206c4d7","signature":false,"affectsGlobalScope":true,"impliedFormat":1},{"version":"fbffd9337146eff822c7c00acbb78b01ea7ea23987f6c961eba689349e744f8c","signature":false,"affectsGlobalScope":true,"impliedFormat":1},{"version":"a995c0e49b721312f74fdfb89e4ba29bd9824c770bbb4021d74d2bf560e4c6bd","signature":false,"affectsGlobalScope":true,"impliedFormat":1},{"version":"c7b3542146734342e440a84b213384bfa188835537ddbda50d30766f0593aff9","signature":false,"affectsGlobalScope":true,"impliedFormat":1},{"version":"ce6180fa19b1cccd07ee7f7dbb9a367ac19c0ed160573e4686425060b6df7f57","signature":false,"affectsGlobalScope":true,"impliedFormat":1},{"version":"3f02e2476bccb9dbe21280d6090f0df17d2f66b74711489415a8aa4df73c9675","signature":false,"affectsGlobalScope":true,"impliedFormat":1},{"version":"45e3ab34c1c013c8ab2dc1ba4c80c780744b13b5676800ae2e3be27ae862c40c","signature":false,"affectsGlobalScope":true,"impliedFormat":1},{"version":"805c86f6cca8d7702a62a844856dbaa2a3fd2abef0536e65d48732441dde5b5b","signature":false,"affectsGlobalScope":true,"impliedFormat":1},{"version":"e42e397f1a5a77994f0185fd1466520691456c772d06bf843e5084ceb879a0ad","signature":false,"affectsGlobalScope":true,"impliedFormat":1},{"version":"f4c2b41f90c95b1c532ecc874bd3c111865793b23aebcc1c3cbbabcd5d76ffb0","signature":false,"affectsGlobalScope":true,"impliedFormat":1},{"version":"ab26191cfad5b66afa11b8bf935ef1cd88fabfcb28d30b2dfa6fad877d050332","signature":false,"affectsGlobalScope":true,"impliedFormat":1},{"version":"2088bc26531e38fb05eedac2951480db5309f6be3fa4a08d2221abb0f5b4200d","signature":false,"affectsGlobalScope":true,"impliedFormat":1},{"version":"cb9d366c425fea79716a8fb3af0d78e6b22ebbab3bd64d25063b42dc9f531c1e","signature":false,"affectsGlobalScope":true,"impliedFormat":1},{"version":"500934a8089c26d57ebdb688fc9757389bb6207a3c8f0674d68efa900d2abb34","signature":false,"affectsGlobalScope":true,"impliedFormat":1},{"version":"689da16f46e647cef0d64b0def88910e818a5877ca5379ede156ca3afb780ac3","signature":false,"affectsGlobalScope":true,"impliedFormat":1},{"version":"bc21cc8b6fee4f4c2440d08035b7ea3c06b3511314c8bab6bef7a92de58a2593","signature":false,"affectsGlobalScope":true,"impliedFormat":1},{"version":"7ca53d13d2957003abb47922a71866ba7cb2068f8d154877c596d63c359fed25","signature":false,"affectsGlobalScope":true,"impliedFormat":1},{"version":"54725f8c4df3d900cb4dac84b64689ce29548da0b4e9b7c2de61d41c79293611","signature":false,"affectsGlobalScope":true,"impliedFormat":1},{"version":"e5594bc3076ac29e6c1ebda77939bc4c8833de72f654b6e376862c0473199323","signature":false,"affectsGlobalScope":true,"impliedFormat":1},{"version":"2f3eb332c2d73e729f3364fcc0c2b375e72a121e8157d25a82d67a138c83a95c","signature":false,"affectsGlobalScope":true,"impliedFormat":1},{"version":"6f4427f9642ce8d500970e4e69d1397f64072ab73b97e476b4002a646ac743b1","signature":false,"affectsGlobalScope":true,"impliedFormat":1},{"version":"48915f327cd1dea4d7bd358d9dc7732f58f9e1626a29cc0c05c8c692419d9bb7","signature":false,"affectsGlobalScope":true,"impliedFormat":1},{"version":"b7bf9377723203b5a6a4b920164df22d56a43f593269ba6ae1fdc97774b68855","signature":false,"affectsGlobalScope":true,"impliedFormat":1},{"version":"db9709688f82c9e5f65a119c64d835f906efe5f559d08b11642d56eb85b79357","signature":false,"affectsGlobalScope":true,"impliedFormat":1},{"version":"4b25b8c874acd1a4cf8444c3617e037d444d19080ac9f634b405583fd10ce1f7","signature":false,"affectsGlobalScope":true,"impliedFormat":1},{"version":"37be57d7c90cf1f8112ee2636a068d8fd181289f82b744160ec56a7dc158a9f5","signature":false,"affectsGlobalScope":true,"impliedFormat":1},{"version":"a917a49ac94cd26b754ab84e113369a75d1a47a710661d7cd25e961cc797065f","signature":false,"affectsGlobalScope":true,"impliedFormat":1},{"version":"6d3261badeb7843d157ef3e6f5d1427d0eeb0af0cf9df84a62cfd29fd47ac86e","signature":false,"affectsGlobalScope":true,"impliedFormat":1},{"version":"195daca651dde22f2167ac0d0a05e215308119a3100f5e6268e8317d05a92526","signature":false,"affectsGlobalScope":true,"impliedFormat":1},{"version":"8b11e4285cd2bb164a4dc09248bdec69e9842517db4ca47c1ba913011e44ff2f","signature":false,"affectsGlobalScope":true,"impliedFormat":1},{"version":"0508571a52475e245b02bc50fa1394065a0a3d05277fbf5120c3784b85651799","signature":false,"affectsGlobalScope":true,"impliedFormat":1},{"version":"8f9af488f510c3015af3cc8c267a9e9d96c4dd38a1fdff0e11dc5a544711415b","signature":false,"affectsGlobalScope":true,"impliedFormat":1},{"version":"fc611fea8d30ea72c6bbfb599c9b4d393ce22e2f5bfef2172534781e7d138104","signature":false,"affectsGlobalScope":true,"impliedFormat":1},{"version":"1ce14b81c5cc821994aa8ec1d42b220dd41b27fcc06373bce3958af7421b77d4","signature":false,"affectsGlobalScope":true,"impliedFormat":1},{"version":"b3a048b3e9302ef9a34ef4ebb9aecfb28b66abb3bce577206a79fee559c230da","signature":false,"affectsGlobalScope":true,"impliedFormat":1},{"version":"01a30f9e8582b369075c0808df71121e6855cb06fd8d3d39511d9ebb66405205","signature":false,"impliedFormat":1},{"version":"558af8e10a8c92c75199bbf52be982758960ec2cae2a0e51ac4e513b2cdff33b","signature":false}],"root":[64],"options":{"allowImportingTsExtensions":true,"composite":true,"declaration":true,"declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":true,"exactOptionalPropertyTypes":true,"module":99,"noEmitOnError":false,"noFallthroughCasesInSwitch":true,"noImplicitOverride":true,"noImplicitReturns":true,"noUncheckedIndexedAccess":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./types","rootDir":"../src","skipLibCheck":true,"sourceMap":true,"strict":true,"target":9,"useDefineForClassFields":true,"verbatimModuleSyntax":true},"changeFileSet":[61,62,12,10,11,16,15,2,17,18,19,20,21,22,23,24,3,25,26,4,27,31,28,29,30,32,33,34,5,35,36,37,38,6,42,39,40,41,43,7,44,49,50,45,46,47,48,8,54,51,52,53,55,9,56,63,57,58,60,59,1,14,13,64],"version":"6.0.2"}