@sheetxl/primitives 0.4.10 → 0.4.11

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.
@@ -1,6 +1,7 @@
1
- "use strict";/**
2
- * @license @sheetxl/primitives - Primitives - Base types for SheetXL functions. - v0.4.10
1
+ /**
2
+ * @license @sheetxl/primitives - Primitives - Base types for SheetXL functions. - v0.4.11
3
3
  *
4
4
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
6
- */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var i;exports.IRange=void 0,(i=exports.IRange||(exports.IRange={})).Orientation={Column:"column",Row:"row"},i.Orientations={...i.Orientation,Both:"both"},i.Direction={Up:"up",Down:"down",Left:"left",Right:"right"},exports.FormulaError=void 0,(e=>{e.Code={Parse:0,Null:1,Div0:2,Value:3,Ref:4,Name:5,Num:6,NA:7,GettingData:8,Spill:9,Connect:10,Blocked:11,Unknown:12,Field:13,Calc:14,Busy:16,Python:19,Timeout:20},e.Label={Parse:"#PARSE!",Null:"#NULL!",Div0:"#DIV/0!",Value:"#VALUE!",Ref:"#REF!",Name:"#NAME?",Num:"#NUM!",NA:"#N/A",GettingData:"#GETTING_DATA",Spill:"#SPILL!",Connect:"#CONNECT!",Blocked:"#BLOCKED!",Unknown:"#UNKNOWN!",Field:"#FIELD!",Calc:"#CALC!",Busy:"#BUSY!",Python:"#PYTHON!",Timeout:"#TIMEOUT!"};class r extends Error{constructor(t,o,U,C){super(U,C),this._label=o,this._code=t,this.details=C}static{this.code=e.Code.Unknown}get isFormulaError(){return!0}getLabel(){return this._label}getCode(){return this._code}equals(t){return!!t&&(this._code===t._code||this._code===t.code)}get[Symbol.toStringTag](){return"[FormulaError]"}toString(){return this.message||this._label}}e.Known=r;class s extends r{constructor(t,o){super(e.Code.Parse,e.Label.Parse,t,o)}static{this.code=e.Code.Parse}getDetails(){const t=this.details;return{line:t?.line??1,column:t?.column??1,offset:t?.offset??0,length:t?.length??0}}}e.Parse=s;class u extends r{constructor(t,o){super(e.Code.Null,e.Label.Null,t,o)}static{this.code=e.Code.Null}}e.Null=u;class c extends r{constructor(t,o){super(e.Code.Div0,e.Label.Div0,t,o)}static{this.code=e.Code.Div0}}e.Div0=c;class N extends r{constructor(t,o){super(e.Code.Value,e.Label.Value,t,o)}static{this.code=e.Code.Value}}e.Value=N;class p extends r{constructor(t,o){super(e.Code.Ref,e.Label.Ref,t,o)}static{this.code=e.Code.Ref}}e.Ref=p;class h extends r{constructor(t,o){super(e.Code.Name,e.Label.Name,t,o)}static{this.code=e.Code.Name}}e.Name=h;class D extends r{constructor(t,o){super(e.Code.Num,e.Label.Num,t,o)}static{this.code=e.Code.Num}}e.Num=D;class y extends r{constructor(t,o){super(e.Code.NA,e.Label.NA,t,o)}static{this.code=e.Code.NA}}e.NA=y;class S extends r{constructor(t,o){super(e.Code.GettingData,e.Label.GettingData,t,o)}static{this.code=e.Code.GettingData}}e.GettingData=S;class L extends r{constructor(t,o){super(e.Code.Spill,e.Label.Spill,t,o)}static{this.code=e.Code.Spill}}e.Spill=L;class x extends r{constructor(t,o){super(e.Code.Connect,e.Label.Connect,t,o)}static{this.code=e.Code.Connect}}e.Connect=x;class f extends r{constructor(t,o){super(e.Code.Blocked,e.Label.Blocked,t,o)}static{this.code=e.Code.Blocked}}e.Blocked=f;class B extends r{constructor(t,o){super(e.Code.Unknown,e.Label.Unknown,t,o)}static{this.code=e.Code.Unknown}}e.Unknown=B;class k extends r{constructor(t,o){super(e.Code.Field,e.Label.Field,t,o)}static{this.code=e.Code.Field}}e.Field=k;class P extends r{constructor(t,o){super(e.Code.Calc,e.Label.Calc,t,o)}static{this.code=e.Code.Calc}}e.Calc=P;class A extends r{constructor(t,o){super(e.Code.Busy,e.Label.Busy,t,o)}static{this.code=e.Code.Busy}}e.Busy=A;class T extends r{constructor(t,o){super(e.Code.Python,e.Label.Python,t,o)}static{this.code=e.Code.Python}}e.Python=T;class R extends r{constructor(t,o){super(e.Code.Timeout,e.Label.Timeout,t,o)}static{this.code=e.Code.Timeout}}e.Timeout=R})(exports.FormulaError||(exports.FormulaError={}));const l={};l[exports.FormulaError.Code.Parse]=exports.FormulaError.Parse,l[exports.FormulaError.Code.Null]=exports.FormulaError.Null,l[exports.FormulaError.Code.Div0]=exports.FormulaError.Div0,l[exports.FormulaError.Code.Value]=exports.FormulaError.Value,l[exports.FormulaError.Code.Ref]=exports.FormulaError.Ref,l[exports.FormulaError.Code.Name]=exports.FormulaError.Name,l[exports.FormulaError.Code.Num]=exports.FormulaError.Num,l[exports.FormulaError.Code.NA]=exports.FormulaError.NA,l[exports.FormulaError.Code.GettingData]=exports.FormulaError.GettingData,l[exports.FormulaError.Code.Spill]=exports.FormulaError.Spill,l[exports.FormulaError.Code.Connect]=exports.FormulaError.Connect,l[exports.FormulaError.Code.Blocked]=exports.FormulaError.Blocked,l[exports.FormulaError.Code.Unknown]=exports.FormulaError.Unknown,l[exports.FormulaError.Code.Field]=exports.FormulaError.Field,l[exports.FormulaError.Code.Calc]=exports.FormulaError.Calc,l[exports.FormulaError.Code.Busy]=exports.FormulaError.Busy,l[exports.FormulaError.Code.Python]=exports.FormulaError.Python,l[exports.FormulaError.Code.Timeout]=exports.FormulaError.Timeout;const g=new Map,m=new Map,E=new Map,b=new Map,F=Object.keys(l);for(let e=0;e<F.length;e++){const r=F[e],s=l[r];E.set(exports.FormulaError.Label[r],s),b.set(exports.FormulaError.Code[r],s);const u=new s;g.set(u.getLabel(),u),m.set(u.getCode(),u)}const O=m.get(exports.FormulaError.Code.Unknown);var n;(n=exports.FormulaError||(exports.FormulaError={})).BuiltIn={Parse:new n.Parse,Null:new n.Null,Div0:new n.Div0,Value:new n.Value,Ref:new n.Ref,Name:new n.Name,Num:new n.Num,NA:new n.NA,GettingData:new n.GettingData,Spill:new n.Spill,Connect:new n.Connect,Blocked:new n.Blocked,Unknown:new n.Unknown,Field:new n.Field,Calc:new n.Calc,Busy:new n.Busy,Python:new n.Python,Timeout:new n.Timeout},n.getBuiltInByLabel=e=>g.get(e),n.newTypedError=(e,r,s)=>{let u;return u=typeof e=="string"?E.get(e):b.get(e),u||(u=n.Unknown),new u(r,s)},n.getBuiltInById=e=>m.get(e)||O;class w{getRange(r){throw new d}getReference(r,s){throw new d}getNumberFormat(r,s){return s?.toString()??""}fromOADate(r){return new Date(r)}toOADate(r){return r.getTime()}getValueAt(r,s){return null}getEntireCoords(){return I}isValidDate(r){return(r instanceof Date||Object.prototype.toString.call(r)==="[object Date]")&&!isNaN(r.getTime())}getPosition(){return v}getFormulaAt(r,s){return null}getSpillAt(r,s){return null}getSheetIndex(r){return-1}getSheetCount(){return 1}markVolatile(){}formatResults(r){}getFunction(r){return null}getAddress(r,s){throw new d}parseAsDateTime(r,s){throw new d}getRuntime(){return V}}class d extends Error{constructor(r="Not implemented in StubbedFormulaContext"){super(r),this.name="NotImplementedError"}}const v=Object.freeze({colIndex:0,rowIndex:0}),I=Object.freeze({colStart:0,rowStart:0,colEnd:Math.pow(2,14)-1,rowEnd:Math.pow(2,20)-1}),V={getCurrencySymbol:()=>"$",getNumberDecimalSeparator:()=>".",getNumberGroupSeparator:()=>",",isDate1904:()=>!1,getLocation:()=>"unknown",getVersion:()=>"1.0.0",getOS:()=>"unknown",getUser:()=>"unidentified",getDescription:()=>"Stubbed Formula Context"},G=new w;exports.FormulaContext=G,exports.Observable=class{constructor(e){this._subscribeFn=e}subscribe(e,r,s){const u=typeof e=="object"?{next:e.next||(()=>{}),error:e.error||(()=>{}),complete:e.complete||(()=>{}),unsubscribe:()=>{}}:{next:e||(()=>{}),error:r||(()=>{}),complete:s||(()=>{}),unsubscribe:()=>{}},c=this._subscribeFn(u);return u.unsubscribe=()=>{typeof c=="function"&&c()},u}},exports.ScalarType={Number:"n",String:"s",Boolean:"b",Error:"e",RichData:"r",Null:"z"},exports.StubbedFormulaContext=w;
6
+ */
7
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e;exports.IRange=void 0,(e=exports.IRange||(exports.IRange={})).Orientation={Column:"column",Row:"row"},e.Orientations={...e.Orientation,Both:"both"},e.Direction={Up:"up",Down:"down",Left:"left",Right:"right"},exports.FormulaError=void 0,(e=>{e.Code={Parse:0,Null:1,Div0:2,Value:3,Ref:4,Name:5,Num:6,NA:7,GettingData:8,Spill:9,Connect:10,Blocked:11,Unknown:12,Field:13,Calc:14,Busy:16,Python:19,Timeout:20},e.Label={Parse:"#PARSE!",Null:"#NULL!",Div0:"#DIV/0!",Value:"#VALUE!",Ref:"#REF!",Name:"#NAME?",Num:"#NUM!",NA:"#N/A",GettingData:"#GETTING_DATA",Spill:"#SPILL!",Connect:"#CONNECT!",Blocked:"#BLOCKED!",Unknown:"#UNKNOWN!",Field:"#FIELD!",Calc:"#CALC!",Busy:"#BUSY!",Python:"#PYTHON!",Timeout:"#TIMEOUT!"};class r extends Error{constructor(e,r,t,o){super(t,o),this._label=r,this._code=e,this.details=o}static{this.code=e.Code.Unknown}get isFormulaError(){return!0}getLabel(){return this._label}getCode(){return this._code}equals(e){return!!e&&(this._code===e._code||this._code===e.code)}get[Symbol.toStringTag](){return"[FormulaError]"}toString(){return this.message||this._label}}e.Known=r;class t extends r{constructor(r,t){super(e.Code.Parse,e.Label.Parse,r,t)}static{this.code=e.Code.Parse}getDetails(){const e=this.details;return{line:e?.line??1,column:e?.column??1,offset:e?.offset??0,length:e?.length??0}}}e.Parse=t;class o extends r{constructor(r,t){super(e.Code.Null,e.Label.Null,r,t)}static{this.code=e.Code.Null}}e.Null=o;class s extends r{constructor(r,t){super(e.Code.Div0,e.Label.Div0,r,t)}static{this.code=e.Code.Div0}}e.Div0=s;class n extends r{constructor(r,t){super(e.Code.Value,e.Label.Value,r,t)}static{this.code=e.Code.Value}}e.Value=n;class l extends r{constructor(r,t){super(e.Code.Ref,e.Label.Ref,r,t)}static{this.code=e.Code.Ref}}e.Ref=l;class a extends r{constructor(r,t){super(e.Code.Name,e.Label.Name,r,t)}static{this.code=e.Code.Name}}e.Name=a;class u extends r{constructor(r,t){super(e.Code.Num,e.Label.Num,r,t)}static{this.code=e.Code.Num}}e.Num=u;class c extends r{constructor(r,t){super(e.Code.NA,e.Label.NA,r,t)}static{this.code=e.Code.NA}}e.NA=c;class i extends r{constructor(r,t){super(e.Code.GettingData,e.Label.GettingData,r,t)}static{this.code=e.Code.GettingData}}e.GettingData=i;class d extends r{constructor(r,t){super(e.Code.Spill,e.Label.Spill,r,t)}static{this.code=e.Code.Spill}}e.Spill=d;class m extends r{constructor(r,t){super(e.Code.Connect,e.Label.Connect,r,t)}static{this.code=e.Code.Connect}}e.Connect=m;class p extends r{constructor(r,t){super(e.Code.Blocked,e.Label.Blocked,r,t)}static{this.code=e.Code.Blocked}}e.Blocked=p;class C extends r{constructor(r,t){super(e.Code.Unknown,e.Label.Unknown,r,t)}static{this.code=e.Code.Unknown}}e.Unknown=C;class x extends r{constructor(r,t){super(e.Code.Field,e.Label.Field,r,t)}static{this.code=e.Code.Field}}e.Field=x;class F extends r{constructor(r,t){super(e.Code.Calc,e.Label.Calc,r,t)}static{this.code=e.Code.Calc}}e.Calc=F;class g extends r{constructor(r,t){super(e.Code.Busy,e.Label.Busy,r,t)}static{this.code=e.Code.Busy}}e.Busy=g;class E extends r{constructor(r,t){super(e.Code.Python,e.Label.Python,r,t)}static{this.code=e.Code.Python}}e.Python=E;class b extends r{constructor(r,t){super(e.Code.Timeout,e.Label.Timeout,r,t)}static{this.code=e.Code.Timeout}}e.Timeout=b})(exports.FormulaError||(exports.FormulaError={}));const r={};r[exports.FormulaError.Code.Parse]=exports.FormulaError.Parse,r[exports.FormulaError.Code.Null]=exports.FormulaError.Null,r[exports.FormulaError.Code.Div0]=exports.FormulaError.Div0,r[exports.FormulaError.Code.Value]=exports.FormulaError.Value,r[exports.FormulaError.Code.Ref]=exports.FormulaError.Ref,r[exports.FormulaError.Code.Name]=exports.FormulaError.Name,r[exports.FormulaError.Code.Num]=exports.FormulaError.Num,r[exports.FormulaError.Code.NA]=exports.FormulaError.NA,r[exports.FormulaError.Code.GettingData]=exports.FormulaError.GettingData,r[exports.FormulaError.Code.Spill]=exports.FormulaError.Spill,r[exports.FormulaError.Code.Connect]=exports.FormulaError.Connect,r[exports.FormulaError.Code.Blocked]=exports.FormulaError.Blocked,r[exports.FormulaError.Code.Unknown]=exports.FormulaError.Unknown,r[exports.FormulaError.Code.Field]=exports.FormulaError.Field,r[exports.FormulaError.Code.Calc]=exports.FormulaError.Calc,r[exports.FormulaError.Code.Busy]=exports.FormulaError.Busy,r[exports.FormulaError.Code.Python]=exports.FormulaError.Python,r[exports.FormulaError.Code.Timeout]=exports.FormulaError.Timeout;const t=new Map,o=new Map,s=new Map,n=new Map,l=Object.keys(r);for(let e=0;e<l.length;e++){const a=l[e],u=r[a];s.set(exports.FormulaError.Label[a],u),n.set(exports.FormulaError.Code[a],u);const c=new u;t.set(c.getLabel(),c),o.set(c.getCode(),c)}const a=o.get(exports.FormulaError.Code.Unknown);var u;(u=exports.FormulaError||(exports.FormulaError={})).BuiltIn={Parse:new u.Parse,Null:new u.Null,Div0:new u.Div0,Value:new u.Value,Ref:new u.Ref,Name:new u.Name,Num:new u.Num,NA:new u.NA,GettingData:new u.GettingData,Spill:new u.Spill,Connect:new u.Connect,Blocked:new u.Blocked,Unknown:new u.Unknown,Field:new u.Field,Calc:new u.Calc,Busy:new u.Busy,Python:new u.Python,Timeout:new u.Timeout},u.getBuiltInByLabel=e=>t.get(e),u.newTypedError=(e,r,t)=>{let o;return o="string"==typeof e?s.get(e):n.get(e),o||(o=u.Unknown),new o(r,t)},u.getBuiltInById=e=>o.get(e)||a;class c{getRange(e){throw new i}getReference(e,r){throw new i}getNumberFormat(e,r){return r?.toString()??""}fromOADate(e){return new Date(e)}toOADate(e){return e.getTime()}getValueAt(e,r){return null}getEntireCoords(){return m}isValidDate(e){return(e instanceof Date||"[object Date]"===Object.prototype.toString.call(e))&&!isNaN(e.getTime())}getPosition(){return d}getFormulaAt(e,r){return null}getSpillAt(e,r){return null}getSheetIndex(e){return-1}getSheetCount(){return 1}markVolatile(){}formatResults(e){}getFunction(e){return null}getAddress(e,r){throw new i}parseAsDateTime(e,r){throw new i}getRuntime(){return p}}class i extends Error{constructor(e="Not implemented in StubbedFormulaContext"){super(e),this.name="NotImplementedError"}}const d=Object.freeze({colIndex:0,rowIndex:0}),m=Object.freeze({colStart:0,rowStart:0,colEnd:Math.pow(2,14)-1,rowEnd:Math.pow(2,20)-1}),p={getCurrencySymbol:()=>"$",getNumberDecimalSeparator:()=>".",getNumberGroupSeparator:()=>",",isDate1904:()=>!1,getLocation:()=>"unknown",getVersion:()=>"1.0.0",getOS:()=>"unknown",getUser:()=>"unidentified",getDescription:()=>"Stubbed Formula Context"},C=new c;exports.FormulaContext=C,exports.Observable=class{constructor(e){this._subscribeFn=e}subscribe(e,r,t){const o="object"==typeof e?{next:e.next||(()=>{}),error:e.error||(()=>{}),complete:e.complete||(()=>{}),unsubscribe:()=>{}}:{next:e||(()=>{}),error:r||(()=>{}),complete:t||(()=>{}),unsubscribe:()=>{}},s=this._subscribeFn(o);return o.unsubscribe=()=>{"function"==typeof s&&s()},o}},exports.ScalarType={Number:"n",String:"s",Boolean:"b",Error:"e",RichData:"r",Null:"z"},exports.StubbedFormulaContext=c;
@@ -1,309 +1,7 @@
1
1
  /**
2
- * @license @sheetxl/primitives - Primitives - Base types for SheetXL functions. - v0.4.10
2
+ * @license @sheetxl/primitives - Primitives - Base types for SheetXL functions. - v0.4.11
3
3
  *
4
4
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
6
6
  */
7
- const M = { Number: "n", String: "s", Boolean: "b", Error: "e", RichData: "r", Null: "z" };
8
- var w, C, n;
9
- (C = w || (w = {})).Orientation = { Column: "column", Row: "row" }, C.Orientations = { ...C.Orientation, Both: "both" }, C.Direction = { Up: "up", Down: "down", Left: "left", Right: "right" }, ((e) => {
10
- e.Code = { Parse: 0, Null: 1, Div0: 2, Value: 3, Ref: 4, Name: 5, Num: 6, NA: 7, GettingData: 8, Spill: 9, Connect: 10, Blocked: 11, Unknown: 12, Field: 13, Calc: 14, Busy: 16, Python: 19, Timeout: 20 }, e.Label = { Parse: "#PARSE!", Null: "#NULL!", Div0: "#DIV/0!", Value: "#VALUE!", Ref: "#REF!", Name: "#NAME?", Num: "#NUM!", NA: "#N/A", GettingData: "#GETTING_DATA", Spill: "#SPILL!", Connect: "#CONNECT!", Blocked: "#BLOCKED!", Unknown: "#UNKNOWN!", Field: "#FIELD!", Calc: "#CALC!", Busy: "#BUSY!", Python: "#PYTHON!", Timeout: "#TIMEOUT!" };
11
- class t extends Error {
12
- constructor(o, s, O, b) {
13
- super(O, b), this._label = s, this._code = o, this.details = b;
14
- }
15
- static {
16
- this.code = e.Code.Unknown;
17
- }
18
- get isFormulaError() {
19
- return !0;
20
- }
21
- getLabel() {
22
- return this._label;
23
- }
24
- getCode() {
25
- return this._code;
26
- }
27
- equals(o) {
28
- return !!o && (this._code === o._code || this._code === o.code);
29
- }
30
- get [Symbol.toStringTag]() {
31
- return "[FormulaError]";
32
- }
33
- toString() {
34
- return this.message || this._label;
35
- }
36
- }
37
- e.Known = t;
38
- class c extends t {
39
- constructor(o, s) {
40
- super(e.Code.Parse, e.Label.Parse, o, s);
41
- }
42
- static {
43
- this.code = e.Code.Parse;
44
- }
45
- getDetails() {
46
- const o = this.details;
47
- return { line: o?.line ?? 1, column: o?.column ?? 1, offset: o?.offset ?? 0, length: o?.length ?? 0 };
48
- }
49
- }
50
- e.Parse = c;
51
- class u extends t {
52
- constructor(o, s) {
53
- super(e.Code.Null, e.Label.Null, o, s);
54
- }
55
- static {
56
- this.code = e.Code.Null;
57
- }
58
- }
59
- e.Null = u;
60
- class i extends t {
61
- constructor(o, s) {
62
- super(e.Code.Div0, e.Label.Div0, o, s);
63
- }
64
- static {
65
- this.code = e.Code.Div0;
66
- }
67
- }
68
- e.Div0 = i;
69
- class d extends t {
70
- constructor(o, s) {
71
- super(e.Code.Value, e.Label.Value, o, s);
72
- }
73
- static {
74
- this.code = e.Code.Value;
75
- }
76
- }
77
- e.Value = d;
78
- class L extends t {
79
- constructor(o, s) {
80
- super(e.Code.Ref, e.Label.Ref, o, s);
81
- }
82
- static {
83
- this.code = e.Code.Ref;
84
- }
85
- }
86
- e.Ref = L;
87
- class y extends t {
88
- constructor(o, s) {
89
- super(e.Code.Name, e.Label.Name, o, s);
90
- }
91
- static {
92
- this.code = e.Code.Name;
93
- }
94
- }
95
- e.Name = y;
96
- class S extends t {
97
- constructor(o, s) {
98
- super(e.Code.Num, e.Label.Num, o, s);
99
- }
100
- static {
101
- this.code = e.Code.Num;
102
- }
103
- }
104
- e.Num = S;
105
- class x extends t {
106
- constructor(o, s) {
107
- super(e.Code.NA, e.Label.NA, o, s);
108
- }
109
- static {
110
- this.code = e.Code.NA;
111
- }
112
- }
113
- e.NA = x;
114
- class B extends t {
115
- constructor(o, s) {
116
- super(e.Code.GettingData, e.Label.GettingData, o, s);
117
- }
118
- static {
119
- this.code = e.Code.GettingData;
120
- }
121
- }
122
- e.GettingData = B;
123
- class f extends t {
124
- constructor(o, s) {
125
- super(e.Code.Spill, e.Label.Spill, o, s);
126
- }
127
- static {
128
- this.code = e.Code.Spill;
129
- }
130
- }
131
- e.Spill = f;
132
- class k extends t {
133
- constructor(o, s) {
134
- super(e.Code.Connect, e.Label.Connect, o, s);
135
- }
136
- static {
137
- this.code = e.Code.Connect;
138
- }
139
- }
140
- e.Connect = k;
141
- class A extends t {
142
- constructor(o, s) {
143
- super(e.Code.Blocked, e.Label.Blocked, o, s);
144
- }
145
- static {
146
- this.code = e.Code.Blocked;
147
- }
148
- }
149
- e.Blocked = A;
150
- class F extends t {
151
- constructor(o, s) {
152
- super(e.Code.Unknown, e.Label.Unknown, o, s);
153
- }
154
- static {
155
- this.code = e.Code.Unknown;
156
- }
157
- }
158
- e.Unknown = F;
159
- class P extends t {
160
- constructor(o, s) {
161
- super(e.Code.Field, e.Label.Field, o, s);
162
- }
163
- static {
164
- this.code = e.Code.Field;
165
- }
166
- }
167
- e.Field = P;
168
- class T extends t {
169
- constructor(o, s) {
170
- super(e.Code.Calc, e.Label.Calc, o, s);
171
- }
172
- static {
173
- this.code = e.Code.Calc;
174
- }
175
- }
176
- e.Calc = T;
177
- class U extends t {
178
- constructor(o, s) {
179
- super(e.Code.Busy, e.Label.Busy, o, s);
180
- }
181
- static {
182
- this.code = e.Code.Busy;
183
- }
184
- }
185
- e.Busy = U;
186
- class E extends t {
187
- constructor(o, s) {
188
- super(e.Code.Python, e.Label.Python, o, s);
189
- }
190
- static {
191
- this.code = e.Code.Python;
192
- }
193
- }
194
- e.Python = E;
195
- class R extends t {
196
- constructor(o, s) {
197
- super(e.Code.Timeout, e.Label.Timeout, o, s);
198
- }
199
- static {
200
- this.code = e.Code.Timeout;
201
- }
202
- }
203
- e.Timeout = R;
204
- })(n || (n = {}));
205
- const a = {};
206
- a[n.Code.Parse] = n.Parse, a[n.Code.Null] = n.Null, a[n.Code.Div0] = n.Div0, a[n.Code.Value] = n.Value, a[n.Code.Ref] = n.Ref, a[n.Code.Name] = n.Name, a[n.Code.Num] = n.Num, a[n.Code.NA] = n.NA, a[n.Code.GettingData] = n.GettingData, a[n.Code.Spill] = n.Spill, a[n.Code.Connect] = n.Connect, a[n.Code.Blocked] = n.Blocked, a[n.Code.Unknown] = n.Unknown, a[n.Code.Field] = n.Field, a[n.Code.Calc] = n.Calc, a[n.Code.Busy] = n.Busy, a[n.Code.Python] = n.Python, a[n.Code.Timeout] = n.Timeout;
207
- const h = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map(), D = /* @__PURE__ */ new Map(), N = Object.keys(a);
208
- for (let e = 0; e < N.length; e++) {
209
- const t = N[e], c = a[t];
210
- p.set(n.Label[t], c), D.set(n.Code[t], c);
211
- const u = new c();
212
- h.set(u.getLabel(), u), g.set(u.getCode(), u);
213
- }
214
- const V = g.get(n.Code.Unknown);
215
- var r;
216
- (r = n || (n = {})).BuiltIn = { Parse: new r.Parse(), Null: new r.Null(), Div0: new r.Div0(), Value: new r.Value(), Ref: new r.Ref(), Name: new r.Name(), Num: new r.Num(), NA: new r.NA(), GettingData: new r.GettingData(), Spill: new r.Spill(), Connect: new r.Connect(), Blocked: new r.Blocked(), Unknown: new r.Unknown(), Field: new r.Field(), Calc: new r.Calc(), Busy: new r.Busy(), Python: new r.Python(), Timeout: new r.Timeout() }, r.getBuiltInByLabel = (e) => h.get(e), r.newTypedError = (e, t, c) => {
217
- let u;
218
- return u = typeof e == "string" ? p.get(e) : D.get(e), u || (u = r.Unknown), new u(t, c);
219
- }, r.getBuiltInById = (e) => g.get(e) || V;
220
- class j {
221
- constructor(t) {
222
- this._subscribeFn = t;
223
- }
224
- subscribe(t, c, u) {
225
- const i = typeof t == "object" ? { next: t.next || (() => {
226
- }), error: t.error || (() => {
227
- }), complete: t.complete || (() => {
228
- }), unsubscribe: () => {
229
- } } : { next: t || (() => {
230
- }), error: c || (() => {
231
- }), complete: u || (() => {
232
- }), unsubscribe: () => {
233
- } }, d = this._subscribeFn(i);
234
- return i.unsubscribe = () => {
235
- typeof d == "function" && d();
236
- }, i;
237
- }
238
- }
239
- class I {
240
- getRange(t) {
241
- throw new m();
242
- }
243
- getReference(t, c) {
244
- throw new m();
245
- }
246
- getNumberFormat(t, c) {
247
- return c?.toString() ?? "";
248
- }
249
- fromOADate(t) {
250
- return new Date(t);
251
- }
252
- toOADate(t) {
253
- return t.getTime();
254
- }
255
- getValueAt(t, c) {
256
- return null;
257
- }
258
- getEntireCoords() {
259
- return G;
260
- }
261
- isValidDate(t) {
262
- return (t instanceof Date || Object.prototype.toString.call(t) === "[object Date]") && !isNaN(t.getTime());
263
- }
264
- getPosition() {
265
- return v;
266
- }
267
- getFormulaAt(t, c) {
268
- return null;
269
- }
270
- getSpillAt(t, c) {
271
- return null;
272
- }
273
- getSheetIndex(t) {
274
- return -1;
275
- }
276
- getSheetCount() {
277
- return 1;
278
- }
279
- markVolatile() {
280
- }
281
- formatResults(t) {
282
- }
283
- getFunction(t) {
284
- return null;
285
- }
286
- getAddress(t, c) {
287
- throw new m();
288
- }
289
- parseAsDateTime(t, c) {
290
- throw new m();
291
- }
292
- getRuntime() {
293
- return _;
294
- }
295
- }
296
- class m extends Error {
297
- constructor(t = "Not implemented in StubbedFormulaContext") {
298
- super(t), this.name = "NotImplementedError";
299
- }
300
- }
301
- const v = Object.freeze({ colIndex: 0, rowIndex: 0 }), G = Object.freeze({ colStart: 0, rowStart: 0, colEnd: Math.pow(2, 14) - 1, rowEnd: Math.pow(2, 20) - 1 }), _ = { getCurrencySymbol: () => "$", getNumberDecimalSeparator: () => ".", getNumberGroupSeparator: () => ",", isDate1904: () => !1, getLocation: () => "unknown", getVersion: () => "1.0.0", getOS: () => "unknown", getUser: () => "unidentified", getDescription: () => "Stubbed Formula Context" }, z = new I();
302
- export {
303
- z as FormulaContext,
304
- n as FormulaError,
305
- w as IRange,
306
- j as Observable,
307
- M as ScalarType,
308
- I as StubbedFormulaContext
309
- };
7
+ const e={Number:"n",String:"s",Boolean:"b",Error:"e",RichData:"r",Null:"z"};var t,o,n;(o=t||(t={})).Orientation={Column:"column",Row:"row"},o.Orientations={...o.Orientation,Both:"both"},o.Direction={Up:"up",Down:"down",Left:"left",Right:"right"},(e=>{e.Code={Parse:0,Null:1,Div0:2,Value:3,Ref:4,Name:5,Num:6,NA:7,GettingData:8,Spill:9,Connect:10,Blocked:11,Unknown:12,Field:13,Calc:14,Busy:16,Python:19,Timeout:20},e.Label={Parse:"#PARSE!",Null:"#NULL!",Div0:"#DIV/0!",Value:"#VALUE!",Ref:"#REF!",Name:"#NAME?",Num:"#NUM!",NA:"#N/A",GettingData:"#GETTING_DATA",Spill:"#SPILL!",Connect:"#CONNECT!",Blocked:"#BLOCKED!",Unknown:"#UNKNOWN!",Field:"#FIELD!",Calc:"#CALC!",Busy:"#BUSY!",Python:"#PYTHON!",Timeout:"#TIMEOUT!"};class t extends Error{constructor(e,t,o,n){super(o,n),this._label=t,this._code=e,this.details=n}static{this.code=e.Code.Unknown}get isFormulaError(){return!0}getLabel(){return this._label}getCode(){return this._code}equals(e){return!!e&&(this._code===e._code||this._code===e.code)}get[Symbol.toStringTag](){return"[FormulaError]"}toString(){return this.message||this._label}}e.Known=t;class o extends t{constructor(t,o){super(e.Code.Parse,e.Label.Parse,t,o)}static{this.code=e.Code.Parse}getDetails(){const e=this.details;return{line:e?.line??1,column:e?.column??1,offset:e?.offset??0,length:e?.length??0}}}e.Parse=o;class n extends t{constructor(t,o){super(e.Code.Null,e.Label.Null,t,o)}static{this.code=e.Code.Null}}e.Null=n;class s extends t{constructor(t,o){super(e.Code.Div0,e.Label.Div0,t,o)}static{this.code=e.Code.Div0}}e.Div0=s;class r extends t{constructor(t,o){super(e.Code.Value,e.Label.Value,t,o)}static{this.code=e.Code.Value}}e.Value=r;class l extends t{constructor(t,o){super(e.Code.Ref,e.Label.Ref,t,o)}static{this.code=e.Code.Ref}}e.Ref=l;class a extends t{constructor(t,o){super(e.Code.Name,e.Label.Name,t,o)}static{this.code=e.Code.Name}}e.Name=a;class c extends t{constructor(t,o){super(e.Code.Num,e.Label.Num,t,o)}static{this.code=e.Code.Num}}e.Num=c;class i extends t{constructor(t,o){super(e.Code.NA,e.Label.NA,t,o)}static{this.code=e.Code.NA}}e.NA=i;class u extends t{constructor(t,o){super(e.Code.GettingData,e.Label.GettingData,t,o)}static{this.code=e.Code.GettingData}}e.GettingData=u;class d extends t{constructor(t,o){super(e.Code.Spill,e.Label.Spill,t,o)}static{this.code=e.Code.Spill}}e.Spill=d;class C extends t{constructor(t,o){super(e.Code.Connect,e.Label.Connect,t,o)}static{this.code=e.Code.Connect}}e.Connect=C;class m extends t{constructor(t,o){super(e.Code.Blocked,e.Label.Blocked,t,o)}static{this.code=e.Code.Blocked}}e.Blocked=m;class g extends t{constructor(t,o){super(e.Code.Unknown,e.Label.Unknown,t,o)}static{this.code=e.Code.Unknown}}e.Unknown=g;class w extends t{constructor(t,o){super(e.Code.Field,e.Label.Field,t,o)}static{this.code=e.Code.Field}}e.Field=w;class N extends t{constructor(t,o){super(e.Code.Calc,e.Label.Calc,t,o)}static{this.code=e.Code.Calc}}e.Calc=N;class h extends t{constructor(t,o){super(e.Code.Busy,e.Label.Busy,t,o)}static{this.code=e.Code.Busy}}e.Busy=h;class b extends t{constructor(t,o){super(e.Code.Python,e.Label.Python,t,o)}static{this.code=e.Code.Python}}e.Python=b;class p extends t{constructor(t,o){super(e.Code.Timeout,e.Label.Timeout,t,o)}static{this.code=e.Code.Timeout}}e.Timeout=p})(n||(n={}));const s={};s[n.Code.Parse]=n.Parse,s[n.Code.Null]=n.Null,s[n.Code.Div0]=n.Div0,s[n.Code.Value]=n.Value,s[n.Code.Ref]=n.Ref,s[n.Code.Name]=n.Name,s[n.Code.Num]=n.Num,s[n.Code.NA]=n.NA,s[n.Code.GettingData]=n.GettingData,s[n.Code.Spill]=n.Spill,s[n.Code.Connect]=n.Connect,s[n.Code.Blocked]=n.Blocked,s[n.Code.Unknown]=n.Unknown,s[n.Code.Field]=n.Field,s[n.Code.Calc]=n.Calc,s[n.Code.Busy]=n.Busy,s[n.Code.Python]=n.Python,s[n.Code.Timeout]=n.Timeout;const r=new Map,l=new Map,a=new Map,c=new Map,i=Object.keys(s);for(let e=0;e<i.length;e++){const t=i[e],o=s[t];a.set(n.Label[t],o),c.set(n.Code[t],o);const u=new o;r.set(u.getLabel(),u),l.set(u.getCode(),u)}const u=l.get(n.Code.Unknown);var d;(d=n||(n={})).BuiltIn={Parse:new d.Parse,Null:new d.Null,Div0:new d.Div0,Value:new d.Value,Ref:new d.Ref,Name:new d.Name,Num:new d.Num,NA:new d.NA,GettingData:new d.GettingData,Spill:new d.Spill,Connect:new d.Connect,Blocked:new d.Blocked,Unknown:new d.Unknown,Field:new d.Field,Calc:new d.Calc,Busy:new d.Busy,Python:new d.Python,Timeout:new d.Timeout},d.getBuiltInByLabel=e=>r.get(e),d.newTypedError=(e,t,o)=>{let n;return n="string"==typeof e?a.get(e):c.get(e),n||(n=d.Unknown),new n(t,o)},d.getBuiltInById=e=>l.get(e)||u;class C{constructor(e){this._subscribeFn=e}subscribe(e,t,o){const n="object"==typeof e?{next:e.next||(()=>{}),error:e.error||(()=>{}),complete:e.complete||(()=>{}),unsubscribe:()=>{}}:{next:e||(()=>{}),error:t||(()=>{}),complete:o||(()=>{}),unsubscribe:()=>{}},s=this._subscribeFn(n);return n.unsubscribe=()=>{"function"==typeof s&&s()},n}}class m{getRange(e){throw new g}getReference(e,t){throw new g}getNumberFormat(e,t){return t?.toString()??""}fromOADate(e){return new Date(e)}toOADate(e){return e.getTime()}getValueAt(e,t){return null}getEntireCoords(){return N}isValidDate(e){return(e instanceof Date||"[object Date]"===Object.prototype.toString.call(e))&&!isNaN(e.getTime())}getPosition(){return w}getFormulaAt(e,t){return null}getSpillAt(e,t){return null}getSheetIndex(e){return-1}getSheetCount(){return 1}markVolatile(){}formatResults(e){}getFunction(e){return null}getAddress(e,t){throw new g}parseAsDateTime(e,t){throw new g}getRuntime(){return h}}class g extends Error{constructor(e="Not implemented in StubbedFormulaContext"){super(e),this.name="NotImplementedError"}}const w=Object.freeze({colIndex:0,rowIndex:0}),N=Object.freeze({colStart:0,rowStart:0,colEnd:Math.pow(2,14)-1,rowEnd:Math.pow(2,20)-1}),h={getCurrencySymbol:()=>"$",getNumberDecimalSeparator:()=>".",getNumberGroupSeparator:()=>",",isDate1904:()=>!1,getLocation:()=>"unknown",getVersion:()=>"1.0.0",getOS:()=>"unknown",getUser:()=>"unidentified",getDescription:()=>"Stubbed Formula Context"},b=new m;export{b as FormulaContext,n as FormulaError,t as IRange,C as Observable,e as ScalarType,m as StubbedFormulaContext};
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license @sheetxl/primitives - Primitives - Base types for SheetXL functions. - v0.4.10
2
+ * @license @sheetxl/primitives - Primitives - Base types for SheetXL functions. - v0.4.11
3
3
  *
4
4
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sheetxl/primitives",
3
3
  "description": "Primitives - Base types for SheetXL functions.",
4
- "version": "0.4.10",
4
+ "version": "0.4.11",
5
5
  "license": "SEE LICENSE IN <LICENSE>",
6
6
  "type": "module",
7
7
  "exports": {