df-script 1.5.0 → 1.7.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.
Files changed (159) hide show
  1. package/README.md +125 -9
  2. package/dist/api.d.ts +3 -2
  3. package/dist/assets/index-DBhGK6Tp.css +1 -0
  4. package/dist/assets/index-DEJEV_tU.js +195 -0
  5. package/dist/columnExpressions/ColumnExpr.d.ts +14 -7
  6. package/dist/columnExpressions/ExprBase.d.ts +26 -12
  7. package/dist/columnExpressions/constants.d.ts +1 -0
  8. package/dist/columnExpressions/functions/all.d.ts +23 -0
  9. package/dist/columnExpressions/functions/coalesce.d.ts +31 -2
  10. package/dist/columnExpressions/functions/element.d.ts +26 -1
  11. package/dist/columnExpressions/functions/exclude.d.ts +24 -0
  12. package/dist/columnExpressions/functions/implode.d.ts +28 -0
  13. package/dist/columnExpressions/functions/lit.d.ts +27 -0
  14. package/dist/columnExpressions/functions/seq_range.d.ts +36 -0
  15. package/dist/columnExpressions/functions/struct.d.ts +31 -0
  16. package/dist/columnExpressions/functions/when.d.ts +38 -8
  17. package/dist/columnExpressions/index.d.ts +2 -1
  18. package/dist/columnExpressions/mixins/AggregationExpr.d.ts +336 -2
  19. package/dist/columnExpressions/mixins/ArithmeticExpr.d.ts +620 -10
  20. package/dist/columnExpressions/mixins/ArrayExpr.d.ts +567 -0
  21. package/dist/columnExpressions/mixins/ComparisonExpr.d.ts +353 -0
  22. package/dist/columnExpressions/mixins/LogicalExpr.d.ts +82 -0
  23. package/dist/columnExpressions/mixins/ManipulationExpr.d.ts +40 -0
  24. package/dist/columnExpressions/mixins/StringExpr.d.ts +658 -5
  25. package/dist/columnExpressions/mixins/StructExpr.d.ts +70 -0
  26. package/dist/columnExpressions/mixins/TemporalExpr.d.ts +530 -4
  27. package/dist/columnExpressions/mixins/WindowExpr.d.ts +313 -2
  28. package/dist/columnExpressions/types.d.ts +2 -0
  29. package/dist/constants.d.ts +11 -0
  30. package/dist/dataframe/dataframe.d.ts +933 -3
  31. package/dist/dataframe/grouped/grouped.d.ts +41 -6
  32. package/dist/dataframe/types.d.ts +1 -0
  33. package/dist/dataframe/utils.d.ts +1 -0
  34. package/dist/datatypes/index.d.ts +3 -2
  35. package/dist/datatypes/types.d.ts +52 -7
  36. package/dist/exceptions/index.d.ts +23 -0
  37. package/dist/functions/concat.d.ts +50 -0
  38. package/dist/functions/read_csv.d.ts +9 -0
  39. package/dist/functions/read_json.d.ts +7 -2
  40. package/dist/index.html +17 -0
  41. package/dist/index.js +6 -6
  42. package/dist/index.mjs +6 -0
  43. package/dist/types.d.ts +51 -16
  44. package/dist/utils/{list.d.ts → array.d.ts} +68 -15
  45. package/dist/utils/binary.d.ts +3 -0
  46. package/dist/utils/csv.d.ts +1 -0
  47. package/dist/utils/date.d.ts +23 -54
  48. package/dist/utils/index.d.ts +3 -2
  49. package/dist/utils/json.d.ts +1 -0
  50. package/dist/utils/number.d.ts +15 -29
  51. package/dist/utils/object.d.ts +27 -0
  52. package/dist/utils/string.d.ts +15 -5
  53. package/package.json +18 -4
  54. package/dist/api.js +0 -26
  55. package/dist/bundle.min.js +0 -1
  56. package/dist/columnExpressions/ColumnExpr.js +0 -219
  57. package/dist/columnExpressions/ExprBase.js +0 -92
  58. package/dist/columnExpressions/constants.js +0 -7
  59. package/dist/columnExpressions/functions/all.js +0 -11
  60. package/dist/columnExpressions/functions/coalesce.js +0 -44
  61. package/dist/columnExpressions/functions/element.js +0 -11
  62. package/dist/columnExpressions/functions/exclude.js +0 -13
  63. package/dist/columnExpressions/functions/implode.js +0 -7
  64. package/dist/columnExpressions/functions/lit.js +0 -17
  65. package/dist/columnExpressions/functions/repeat.d.ts +0 -47
  66. package/dist/columnExpressions/functions/repeat.js +0 -131
  67. package/dist/columnExpressions/functions/seq_range.js +0 -91
  68. package/dist/columnExpressions/functions/when.js +0 -85
  69. package/dist/columnExpressions/index.js +0 -38
  70. package/dist/columnExpressions/mixins/AggregationExpr.js +0 -76
  71. package/dist/columnExpressions/mixins/ArithmeticExpr.js +0 -131
  72. package/dist/columnExpressions/mixins/BooleanExpr.d.ts +0 -40
  73. package/dist/columnExpressions/mixins/BooleanExpr.js +0 -67
  74. package/dist/columnExpressions/mixins/ComparisonExpr.js +0 -250
  75. package/dist/columnExpressions/mixins/ListExpr.d.ts +0 -39
  76. package/dist/columnExpressions/mixins/ListExpr.js +0 -224
  77. package/dist/columnExpressions/mixins/LogicalExpr.js +0 -53
  78. package/dist/columnExpressions/mixins/ManipulationExpr.js +0 -71
  79. package/dist/columnExpressions/mixins/NumericExpr.d.ts +0 -92
  80. package/dist/columnExpressions/mixins/NumericExpr.js +0 -259
  81. package/dist/columnExpressions/mixins/StringExpr.js +0 -237
  82. package/dist/columnExpressions/mixins/StructExpr.js +0 -139
  83. package/dist/columnExpressions/mixins/TemporalExpr.js +0 -126
  84. package/dist/columnExpressions/mixins/WindowExpr.js +0 -151
  85. package/dist/columnExpressions/types.js +0 -2
  86. package/dist/columnExpressions/utils.js +0 -45
  87. package/dist/dataframe/constants.js +0 -7
  88. package/dist/dataframe/dataframe.js +0 -990
  89. package/dist/dataframe/grouped/grouped.js +0 -114
  90. package/dist/dataframe/index.js +0 -20
  91. package/dist/dataframe/types.js +0 -2
  92. package/dist/dataframe/utils.js +0 -307
  93. package/dist/datatypes/DataType.js +0 -76
  94. package/dist/datatypes/index.js +0 -46
  95. package/dist/datatypes/types/Binary.d.ts +0 -9
  96. package/dist/datatypes/types/Binary.js +0 -18
  97. package/dist/datatypes/types/Boolean.d.ts +0 -9
  98. package/dist/datatypes/types/Boolean.js +0 -19
  99. package/dist/datatypes/types/Date.d.ts +0 -8
  100. package/dist/datatypes/types/Date.js +0 -21
  101. package/dist/datatypes/types/Datetime.d.ts +0 -8
  102. package/dist/datatypes/types/Datetime.js +0 -17
  103. package/dist/datatypes/types/Decimal.d.ts +0 -10
  104. package/dist/datatypes/types/Decimal.js +0 -28
  105. package/dist/datatypes/types/Duration.d.ts +0 -8
  106. package/dist/datatypes/types/Duration.js +0 -17
  107. package/dist/datatypes/types/Float32.d.ts +0 -8
  108. package/dist/datatypes/types/Float32.js +0 -17
  109. package/dist/datatypes/types/Float64.d.ts +0 -8
  110. package/dist/datatypes/types/Float64.js +0 -17
  111. package/dist/datatypes/types/Int16.d.ts +0 -8
  112. package/dist/datatypes/types/Int16.js +0 -17
  113. package/dist/datatypes/types/Int32.d.ts +0 -8
  114. package/dist/datatypes/types/Int32.js +0 -17
  115. package/dist/datatypes/types/Int64.d.ts +0 -8
  116. package/dist/datatypes/types/Int64.js +0 -17
  117. package/dist/datatypes/types/Int8.d.ts +0 -8
  118. package/dist/datatypes/types/Int8.js +0 -17
  119. package/dist/datatypes/types/List.d.ts +0 -10
  120. package/dist/datatypes/types/List.js +0 -31
  121. package/dist/datatypes/types/Null.d.ts +0 -9
  122. package/dist/datatypes/types/Null.js +0 -17
  123. package/dist/datatypes/types/Object.d.ts +0 -9
  124. package/dist/datatypes/types/Object.js +0 -17
  125. package/dist/datatypes/types/Struct.d.ts +0 -14
  126. package/dist/datatypes/types/Struct.js +0 -39
  127. package/dist/datatypes/types/Time.d.ts +0 -8
  128. package/dist/datatypes/types/Time.js +0 -29
  129. package/dist/datatypes/types/UInt16.d.ts +0 -8
  130. package/dist/datatypes/types/UInt16.js +0 -17
  131. package/dist/datatypes/types/UInt32.d.ts +0 -8
  132. package/dist/datatypes/types/UInt32.js +0 -17
  133. package/dist/datatypes/types/UInt64.d.ts +0 -8
  134. package/dist/datatypes/types/UInt64.js +0 -17
  135. package/dist/datatypes/types/UInt8.d.ts +0 -8
  136. package/dist/datatypes/types/UInt8.js +0 -17
  137. package/dist/datatypes/types/Utf8.d.ts +0 -10
  138. package/dist/datatypes/types/Utf8.js +0 -20
  139. package/dist/datatypes/types.js +0 -290
  140. package/dist/exceptions/index.js +0 -46
  141. package/dist/exceptions/utils.js +0 -28
  142. package/dist/functions/concat.js +0 -260
  143. package/dist/functions/index.js +0 -9
  144. package/dist/functions/read_csv.js +0 -53
  145. package/dist/functions/read_json.js +0 -21
  146. package/dist/functions/transpose.d.ts +0 -7
  147. package/dist/functions/transpose.js +0 -84
  148. package/dist/types.js +0 -2
  149. package/dist/utils/boolean.d.ts +0 -1
  150. package/dist/utils/boolean.js +0 -18
  151. package/dist/utils/csv.js +0 -313
  152. package/dist/utils/date.js +0 -348
  153. package/dist/utils/guards.d.ts +0 -12
  154. package/dist/utils/guards.js +0 -112
  155. package/dist/utils/index.js +0 -23
  156. package/dist/utils/json.js +0 -217
  157. package/dist/utils/list.js +0 -361
  158. package/dist/utils/number.js +0 -401
  159. package/dist/utils/string.js +0 -209
@@ -1,14 +1,49 @@
1
1
  import { DataFrame } from "../dataframe";
2
2
  import type { GroupMap } from "../types";
3
3
  import type { IExpr, ColumnDict, RowRecord, DataFrameSchema } from "../../types";
4
+ /**
5
+ * Represents a DataFrame grouped by key columns, supporting aggregation operations.
6
+ * @namespace df
7
+ * @category DataFrame
8
+ * @syntax df.groupby(...).{symbol}(...)
9
+ */
4
10
  export declare class GroupedData<T, K extends keyof T> {
5
- private groups;
6
- private keys;
7
- private allKeys;
8
- private parentColumns;
9
- private parentHeight;
10
- private parentSchema;
11
+ private _groups;
12
+ private _keys;
13
+ private _allKeys;
14
+ private _parentColumns;
15
+ private _parentHeight;
16
+ private _parentSchema;
11
17
  constructor(groups: GroupMap, keys: K[], allKeys: (keyof T)[], parentColumns: ColumnDict, parentHeight: number, parentSchema: DataFrameSchema);
18
+ /**
19
+ * Converts group keys back into a single distinct DataFrame without aggregations.
20
+ * @returns DataFrame
21
+ * @example
22
+ * >>> const df = $df.data({ group: ["A", "A", "B"], val: [1, 2, 3] })
23
+ * >>> df.groupby("group").to_dataframe()
24
+ * shape: (2, 1)
25
+ * ┌───────┐
26
+ * │ group │
27
+ * ├───────┤
28
+ * │ A │
29
+ * │ B │
30
+ * └───────┘
31
+ */
12
32
  to_dataframe<U extends RowRecord = any>(): DataFrame<U>;
33
+ /**
34
+ * Aggregates grouped partitions using aggregation column expressions.
35
+ * @param exprs One or more aggregation column expressions.
36
+ * @returns DataFrame
37
+ * @example
38
+ * >>> const df = $df.data({ group: ["A", "A", "B"], val: [10, 20, 30] })
39
+ * >>> df.groupby("group").agg($df.col("val").sum().alias("sum_val"))
40
+ * shape: (2, 2)
41
+ * ┌───────┬─────────┐
42
+ * │ group │ sum_val │
43
+ * ├───────┼─────────┤
44
+ * │ A │ 30 │
45
+ * │ B │ 30 │
46
+ * └───────┴─────────┘
47
+ */
13
48
  agg<U extends RowRecord = any>(...exprs: (IExpr | any)[]): DataFrame<U>;
14
49
  }
@@ -1,3 +1,4 @@
1
+ /** @typefile */
1
2
  import type { IExpr, AggFn, RowRecord, DataFrameSchema, JSONFormat } from "../types";
2
3
  import type { DataFrame } from "./dataframe";
3
4
  import type { JSONParseOptions, SafeJsonReplacerOptions, NDJSONParseOptions } from "../utils";
@@ -1,3 +1,4 @@
1
+ /** @internalfile */
1
2
  import type { IExpr, ColumnData, ColumnDict, RegisteredDataType } from "../types";
2
3
  export declare function resolveWindowExpr(expr: IExpr, columns: ColumnDict, height: number): ColumnData;
3
4
  export declare function rowsToColumns(rows: any[]): {
@@ -1,5 +1,5 @@
1
1
  import { DataType as BaseDataType } from "./DataType";
2
- import { DecimalType } from "./types";
2
+ import { DecimalType, BooleanDataType as Boolean, DateDataType as Date, ObjectDataType as Object, ArrayDataType as Array } from "./types";
3
3
  export { BaseDataType as DataType };
4
4
  export declare const DataTypeRegistry: {
5
5
  Int8: import("./types").Int8Type;
@@ -22,8 +22,9 @@ export declare const DataTypeRegistry: {
22
22
  Duration: import("./types").DurationType;
23
23
  Object: import("./types").ObjectType;
24
24
  Null: import("./types").NullType;
25
- List: <TInner>(inner: import("./types").RegisteredDataType & BaseDataType<TInner>) => import("./types").ListType<TInner>;
25
+ Array: <TInner>(inner: import("./types").RegisteredDataType & BaseDataType<TInner>) => import("./types").ArrayType<TInner>;
26
26
  Struct: <TFields extends import("..").RowRecord>(fields: { [K in keyof TFields]: import("./types").RegisteredDataType & BaseDataType<TFields[K]>; }) => import("./types").StructType<TFields>;
27
27
  };
28
+ export { Boolean, Date, Object, Array };
28
29
  export * from "./types";
29
30
  export * from "./DataType";
@@ -1,3 +1,4 @@
1
+ /** @typefile */
1
2
  import { DataType, SignedIntegerType, UnsignedIntegerType, FloatDataType, TemporalDataType, NestedDataType, NumericDataType } from "./DataType";
2
3
  import type { RowRecord } from "../types";
3
4
  export declare class Int8Type extends SignedIntegerType {
@@ -14,6 +15,10 @@ export declare class Int16Type extends SignedIntegerType {
14
15
  allocate(size: number): Int16Array;
15
16
  }
16
17
  export declare const Int16: Int16Type;
18
+ /**
19
+ * 32-bit signed integer type (values from -2,147,483,648 to 2,147,483,647).
20
+ *
21
+ */
17
22
  export declare class Int32Type extends SignedIntegerType {
18
23
  readonly name = "Int32";
19
24
  coerce(val: unknown): number | null;
@@ -21,6 +26,10 @@ export declare class Int32Type extends SignedIntegerType {
21
26
  allocate(size: number): Int32Array;
22
27
  }
23
28
  export declare const Int32: Int32Type;
29
+ /**
30
+ * 64-bit signed integer type (represented as JavaScript BigInt).
31
+ *
32
+ */
24
33
  export declare class Int64Type extends SignedIntegerType<bigint | null> {
25
34
  readonly name = "Int64";
26
35
  coerce(val: unknown): bigint | null;
@@ -63,6 +72,10 @@ export declare class Float32Type extends FloatDataType {
63
72
  allocate(size: number): Float32Array;
64
73
  }
65
74
  export declare const Float32: Float32Type;
75
+ /**
76
+ * 64-bit double precision floating point number type.
77
+ *
78
+ */
66
79
  export declare class Float64Type extends FloatDataType {
67
80
  readonly name = "Float64";
68
81
  coerce(val: unknown): number | null;
@@ -70,6 +83,12 @@ export declare class Float64Type extends FloatDataType {
70
83
  allocate(size: number): Float64Array;
71
84
  }
72
85
  export declare const Float64: Float64Type;
86
+ /**
87
+ * Fixed point decimal type with optional precision and scale arguments.
88
+ *
89
+ * @param precision Precision level (total number of digits)
90
+ * @param scale Scale level (number of decimal place digits)
91
+ */
73
92
  export declare class DecimalType extends NumericDataType {
74
93
  readonly precision?: number | undefined;
75
94
  readonly scale?: number | undefined;
@@ -79,6 +98,10 @@ export declare class DecimalType extends NumericDataType {
79
98
  equals(other: DataType): boolean;
80
99
  allocate(size: number): (number | null)[];
81
100
  }
101
+ /**
102
+ * Boolean datatype representing binary values (true or false).
103
+ *
104
+ */
82
105
  export declare class BooleanType extends DataType<boolean | null> {
83
106
  readonly name = "Boolean";
84
107
  get isBoolean(): boolean;
@@ -86,7 +109,11 @@ export declare class BooleanType extends DataType<boolean | null> {
86
109
  equals(other: DataType): boolean;
87
110
  allocate(size: number): (boolean | null)[];
88
111
  }
89
- export declare const Boolean: BooleanType;
112
+ export declare const BooleanDataType: BooleanType;
113
+ /**
114
+ * Unicode UTF-8 string datatype.
115
+ *
116
+ */
90
117
  export declare class Utf8Type extends DataType<string | null> {
91
118
  readonly name = "Utf8";
92
119
  get isString(): boolean;
@@ -119,14 +146,22 @@ export declare class ObjectType extends DataType {
119
146
  equals(other: DataType): boolean;
120
147
  allocate(size: number): any[];
121
148
  }
122
- export declare const Object: ObjectType;
149
+ export declare const ObjectDataType: ObjectType;
150
+ /**
151
+ * Calendar date type storing UTC year, month, and day.
152
+ *
153
+ */
123
154
  export declare class DateType extends TemporalDataType<Date | null> {
124
155
  readonly name = "Date";
125
156
  coerce(val: unknown): Date | null;
126
157
  equals(other: DataType): boolean;
127
158
  allocate(size: number): (Date | null)[];
128
159
  }
129
- export declare const Date: DateType;
160
+ export declare const DateDataType: DateType;
161
+ /**
162
+ * Date and time type (year, month, day, hour, minute, second, millisecond).
163
+ *
164
+ */
130
165
  export declare class DatetimeType extends TemporalDataType<Date | null> {
131
166
  readonly name = "Datetime";
132
167
  coerce(val: unknown): Date | null;
@@ -148,15 +183,25 @@ export declare class DurationType extends TemporalDataType<number | null> {
148
183
  allocate(size: number): (number | null)[];
149
184
  }
150
185
  export declare const Duration: DurationType;
151
- export declare class ListType<TInner = any> extends NestedDataType<TInner[] | null> {
186
+ /**
187
+ * Nested array list datatype wrapping an inner element type.
188
+ *
189
+ * @param innerType The child elements datatype
190
+ */
191
+ export declare class ArrayType<TInner = any> extends NestedDataType<TInner[] | null> {
152
192
  readonly innerType: RegisteredDataType & DataType<TInner>;
153
- readonly name = "List";
193
+ readonly name = "Array";
154
194
  constructor(innerType: RegisteredDataType & DataType<TInner>);
155
195
  coerce(val: unknown): TInner[] | null;
156
196
  equals(other: DataType): boolean;
157
197
  allocate(size: number): (TInner[] | null)[];
158
198
  }
159
- export declare const List: <TInner>(inner: RegisteredDataType & DataType<TInner>) => ListType<TInner>;
199
+ export declare const ArrayDataType: <TInner>(inner: RegisteredDataType & DataType<TInner>) => ArrayType<TInner>;
200
+ /**
201
+ * Keyed struct object datatype wrapping sub-field schemas.
202
+ *
203
+ * @param fields Schema mapping of field names to Datatypes
204
+ */
160
205
  export declare class StructType<TFields extends RowRecord = any> extends NestedDataType<TFields | null> {
161
206
  readonly fields: {
162
207
  [K in keyof TFields]: RegisteredDataType & DataType<TFields[K]>;
@@ -170,4 +215,4 @@ export declare class StructType<TFields extends RowRecord = any> extends NestedD
170
215
  allocate(size: number): (TFields | null)[];
171
216
  }
172
217
  export declare const Struct: <TFields extends RowRecord>(fields: { [K in keyof TFields]: RegisteredDataType & DataType<TFields[K]>; }) => StructType<TFields>;
173
- export type RegisteredDataType = Int8Type | Int16Type | Int32Type | Int64Type | UInt8Type | UInt16Type | UInt32Type | UInt64Type | Float32Type | Float64Type | DecimalType | BooleanType | Utf8Type | BinaryType | NullType | ObjectType | DateType | DatetimeType | TimeType | DurationType | ListType<any> | StructType<any>;
218
+ export type RegisteredDataType = Int8Type | Int16Type | Int32Type | Int64Type | UInt8Type | UInt16Type | UInt32Type | UInt64Type | Float32Type | Float64Type | DecimalType | BooleanType | Utf8Type | BinaryType | NullType | ObjectType | DateType | DatetimeType | TimeType | DurationType | ArrayType<any> | StructType<any>;
@@ -1,15 +1,38 @@
1
+ /**
2
+ * @namespace Exception
3
+ * @category Exception
4
+ * @syntax throw new {symbol}("message")
5
+ */
6
+ /**
7
+ * Base exception class for all df-script errors.
8
+ */
1
9
  export declare class DFScriptError extends Error {
2
10
  constructor(message: string);
3
11
  }
12
+ /**
13
+ * General error thrown during DataFrame instantiation or execution.
14
+ */
4
15
  export declare class DataFrameError extends DFScriptError {
5
16
  }
17
+ /**
18
+ * Error thrown when a specified column name does not exist in the DataFrame schema.
19
+ */
6
20
  export declare class ColumnNotFoundError extends DataFrameError {
7
21
  constructor(columnName: string, message?: string);
8
22
  }
23
+ /**
24
+ * Error thrown when schema definitions, coercions, or data types are invalid.
25
+ */
9
26
  export declare class SchemaError extends DFScriptError {
10
27
  }
28
+ /**
29
+ * Error thrown during expression evaluation or element-wise calculations.
30
+ */
11
31
  export declare class ComputeError extends DFScriptError {
12
32
  }
33
+ /**
34
+ * Error thrown when shape dimensions or column heights mismatch.
35
+ */
13
36
  export declare class ShapeError extends DFScriptError {
14
37
  }
15
38
  export * from "./utils";
@@ -1,3 +1,53 @@
1
1
  import { DataFrame } from "../dataframe/dataframe";
2
2
  import type { ConcatOptions, ConcatItem, RowRecord } from "../types";
3
+ /**
4
+ * Concatenates items vertically, horizontally, or diagonally.
5
+ * @namespace $df
6
+ * @category ColumnExpression
7
+ * @syntax $df.{symbol}(...)
8
+ * @param rawItems Single DataFrame or array of DataFrames/rows to concatenate.
9
+ * @param [options] Configuration options for concatenation layout and strictness.
10
+ * @param [options.how] Layout strategy: `"vertical"` (default, appends rows top-to-bottom), `"horizontal"` (joins unique columns side-by-side), or `"diagonal"` (concatenates mismatched columns with null padding).
11
+ * @param [options.horizontal.strict] When `true` (default), throws an error if row counts mismatch in horizontal concatenation. Set `false` to pad shorter DataFrames with `null`.
12
+ * @returns DataFrame
13
+ *
14
+ * @example
15
+ * // 1. Vertical Concatenation (default):
16
+ * >>> const df1 = $df.data({ a: [1] })
17
+ * >>> const df2 = $df.data({ a: [2] })
18
+ * >>> $df.concat([df1, df2], { how: "vertical" })
19
+ * shape: (2, 1)
20
+ * ┌───┐
21
+ * │ a │
22
+ * ├───┤
23
+ * │ 1 │
24
+ * │ 2 │
25
+ * └───┘
26
+ *
27
+ * @example
28
+ * // 2. Horizontal Concatenation:
29
+ * >>> const df1 = $df.data({ a: [1] })
30
+ * >>> const df2 = $df.data({ b: [2] })
31
+ * >>> $df.concat([df1, df2], { how: "horizontal" })
32
+ * shape: (1, 2)
33
+ * ┌───┬───┐
34
+ * │ a │ b │
35
+ * ├───┼───┤
36
+ * │ 1 │ 2 │
37
+ * └───┴───┘
38
+ *
39
+ * @example
40
+ * // 3. Diagonal Concatenation (mismatched columns):
41
+ * >>> const df1 = $df.data({ a: [1] })
42
+ * >>> const df2 = $df.data({ b: [2] })
43
+ * >>> $df.concat([df1, df2], { how: "diagonal" })
44
+ * shape: (2, 2)
45
+ * ┌──────┬──────┐
46
+ * │ a │ b │
47
+ * ├──────┼──────┤
48
+ * │ 1 │ null │
49
+ * │ null │ 2 │
50
+ * └──────┴──────┘
51
+ *
52
+ */
3
53
  export declare function concat<U extends RowRecord = any>(rawItems: ConcatItem | ConcatItem[], { how, horizontal }?: ConcatOptions): DataFrame<U>;
@@ -4,5 +4,14 @@ import type { RowRecord } from "../types";
4
4
  /**
5
5
  * Reads a CSV string and constructs a DataFrame.
6
6
  * Automatically infers column data types unless an explicit schema is provided.
7
+ * @namespace $df
8
+ * @category ColumnExpression
9
+ * @syntax $df.{symbol}(...)
10
+ * @param content The CSV content string.
11
+ * @param [options] Parse and configuration options.
12
+ * @param [options.hasHeader] Whether the first row is a header row (default `true`).
13
+ * @param [options.schema] Optional column schema to coerce types.
14
+ * @param [options.inferSchema] When `true` (default), automatically infers column types.
15
+ * @returns DataFrame
7
16
  */
8
17
  export declare function read_csv<T extends RowRecord = any>(content: string, options?: ReadCSVOptions): DataFrame<T>;
@@ -2,9 +2,14 @@ import { DataFrame } from "../dataframe/dataframe";
2
2
  import type { ReadJSONOptions } from "../dataframe/types";
3
3
  /**
4
4
  * Parses JSON content (JSON or NDJSON) and loads it into a new DataFrame.
5
- *
5
+ * @namespace $df
6
+ * @category ColumnExpression
7
+ * @syntax $df.{symbol}(...)
6
8
  * @param content The JSON or NDJSON content string.
7
- * @param options Parse and configuration options.
9
+ * @param [options] Parse and configuration options.
10
+ * @param [options.format] Input format (`"json"` or `"ndjson"`). Default `"json"`.
11
+ * @param [options.trimBeforeParse] When `true` (default), trims whitespace before parsing.
12
+ * @param [options.schema] Optional column schema to coerce types.
8
13
  * @returns A new DataFrame instance populated with the parsed records.
9
14
  */
10
15
  export declare function read_json(content: string, { format, trimBeforeParse, schema, ...parseOpts }?: ReadJSONOptions): DataFrame<any>;
@@ -0,0 +1,17 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>🚀 DFScript Interactive Playground</title>
7
+ <!-- Google Fonts: Outfit (headings) & Inter (body) & Fira Code (monocode) -->
8
+ <link rel="preconnect" href="https://fonts.googleapis.com">
9
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
10
+ <link href="https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500&family=Inter:wght@300;400;500;600&family=Outfit:wght@400;500;600;700;800&display=swap" rel="stylesheet">
11
+ <script type="module" crossorigin src="/assets/index-DEJEV_tU.js"></script>
12
+ <link rel="stylesheet" crossorigin href="/assets/index-DBhGK6Tp.css">
13
+ </head>
14
+ <body>
15
+ <div id="root"></div>
16
+ </body>
17
+ </html>