@kokimoki/app 0.4.3 → 0.4.4

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/dist/fields.d.ts CHANGED
@@ -8,6 +8,14 @@ export declare abstract class Field<T> {
8
8
  abstract get value(): T;
9
9
  abstract get schema(): any;
10
10
  }
11
+ export declare class BooleanField extends Field<boolean> {
12
+ value: boolean;
13
+ constructor(value: boolean, options?: FieldOptions);
14
+ get schema(): {
15
+ type: string;
16
+ default: boolean;
17
+ };
18
+ }
11
19
  export declare class ConstField<T extends string> extends Field<string extends T ? never : T> {
12
20
  value: string extends T ? never : T;
13
21
  constructor(value: string extends T ? never : T, options?: FieldOptions);
package/dist/fields.js CHANGED
@@ -7,6 +7,19 @@ export class Field {
7
7
  this.options = options;
8
8
  }
9
9
  }
10
+ export class BooleanField extends Field {
11
+ value;
12
+ constructor(value, options = defaultFieldOptions) {
13
+ super(options);
14
+ this.value = value;
15
+ }
16
+ get schema() {
17
+ return {
18
+ type: "boolean",
19
+ default: this.value,
20
+ };
21
+ }
22
+ }
10
23
  export class ConstField extends Field {
11
24
  value;
12
25
  constructor(value, options = defaultFieldOptions) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kokimoki/app",
3
- "version": "0.4.3",
3
+ "version": "0.4.4",
4
4
  "type": "module",
5
5
  "description": "Kokimoki app",
6
6
  "main": "dist/index.js",