@asod/field 0.1.0-canary.0 → 0.1.0-canary.1

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/field.d.ts CHANGED
@@ -1,18 +1,18 @@
1
- import { type IField, type IOperation, type IOperationValue } from './declarations/index';
2
- type FieldOperationConfig<TValue extends Primitive | IOperationValue> = {
3
- func: IOperation<TValue>;
1
+ import { type Field } from './declarations/index';
2
+ type FieldOperationConfig<TValue extends Field.OperationValue> = {
3
+ func: Field.IOperation<TValue>;
4
4
  neutralValue: TValue;
5
5
  };
6
- type FieldOperationsConfig<TValue extends Primitive | IOperationValue> = {
6
+ type FieldOperationsConfig<TValue extends Field.OperationValue> = {
7
7
  add: FieldOperationConfig<TValue>;
8
8
  sub: FieldOperationConfig<TValue>;
9
9
  mul: FieldOperationConfig<TValue>;
10
10
  div: FieldOperationConfig<TValue>;
11
11
  };
12
- type FieldConfig<TValue extends Primitive | IOperationValue> = {
12
+ type FieldConfig<TValue extends Field.OperationValue> = {
13
13
  operations: FieldOperationsConfig<TValue>;
14
14
  };
15
- declare class Field<TValue extends Primitive | IOperationValue> implements IField<TValue> {
15
+ declare class Field<TValue extends Field.OperationValue> implements Field.IField<TValue> {
16
16
  private readonly _operations;
17
17
  constructor(config: FieldConfig<TValue>);
18
18
  add(a: TValue, b: TValue): TValue;
package/dist/index.d.ts CHANGED
@@ -1,46 +1,51 @@
1
1
  /// <reference path="global.d.ts" />
2
2
 
3
+ import ASOD from '@asod/core';
3
4
  import { type Comparator } from '@asod/compare';
4
5
 
5
6
  declare const ABSTRACT_OPERATION_ID: unique symbol;
6
7
 
7
8
  type AbstractOperationId = typeof ABSTRACT_OPERATION_ID;
8
9
 
9
- declare namespace ASOD {
10
- /* Common */
10
+ declare module '@asod/core' {
11
+ namespace Field {
12
+ /* Common */
11
13
 
12
- interface IComparable {
13
- comparator?: Comparator;
14
- }
14
+ interface IComparable {
15
+ comparator?: Comparator;
16
+ }
15
17
 
16
- /* Operation */
18
+ /* Operation */
17
19
 
18
- interface IOperationValue extends IComparable {}
20
+ interface IOperationValue extends IComparable {}
19
21
 
20
- interface IOperation<TValue extends Primitive | IOperationValue> {
21
- (a: TValue, b: TValue): TValue;
22
- }
22
+ type OperationValue = Primitive | IOperationValue;
23
23
 
24
- /* Group */
24
+ interface IOperation<TValue extends OperationValue> {
25
+ (a: TValue, b: TValue): TValue;
26
+ }
25
27
 
26
- interface IGroup<TValue extends Primitive | IOperationValue> {
27
- [ABSTRACT_OPERATION_ID]: IOperation<TValue>;
28
- }
28
+ /* Group */
29
29
 
30
- /* Ring */
30
+ interface IGroup<TValue extends OperationValue> {
31
+ [ABSTRACT_OPERATION_ID]: IOperation<TValue>;
32
+ }
31
33
 
32
- // prettier-ignore
33
- interface IRing<TValue extends Primitive | IOperationValue> extends Omit<IGroup<TValue>, AbstractOperationId> {
34
- add: IOperation<TValue>;
35
- mul: IOperation<TValue>;
36
- }
34
+ /* Ring */
35
+
36
+ // prettier-ignore
37
+ interface IRing<TValue extends OperationValue> extends Omit<IGroup<TValue>, AbstractOperationId> {
38
+ add: IOperation<TValue>;
39
+ mul: IOperation<TValue>;
40
+ }
37
41
 
38
- /* Field */
42
+ /* Field */
39
43
 
40
- // prettier-ignore
41
- interface IField<TValue extends Primitive | IOperationValue> extends Omit<IRing<TValue>, AbstractOperationId> {
42
- sub: IOperation<TValue>;
43
- div: IOperation<TValue>;
44
+ // prettier-ignore
45
+ interface IField<TValue extends OperationValue> extends Omit<IRing<TValue>, AbstractOperationId> {
46
+ sub: IOperation<TValue>;
47
+ div: IOperation<TValue>;
48
+ }
44
49
  }
45
50
  }
46
51
 
@@ -1,2 +1,2 @@
1
- import { IComparable, IOperationValue } from '../declarations/index';
2
- export declare const isComparable: (value: Primitive | IOperationValue) => value is IComparable;
1
+ import { type Field } from '../declarations/index';
2
+ export declare const isComparable: (value: Field.OperationValue) => value is Field.IComparable;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@asod/field",
3
3
  "description": "",
4
- "version": "0.1.0-canary.0",
4
+ "version": "0.1.0-canary.1",
5
5
  "license": "MIT",
6
6
  "author": "Oleg Putseiko <oleg.putseiko@gmail.com> (https://github.com/oleg-putseiko)",
7
7
  "keywords": [],
@@ -56,6 +56,7 @@
56
56
  "yarn": "4.10.3"
57
57
  },
58
58
  "dependencies": {
59
- "@asod/compare": "^0.1.1-canary.1"
59
+ "@asod/compare": "^0.1.1-canary.1",
60
+ "@asod/core": "^0.1.0-canary.0"
60
61
  }
61
62
  }
package/dist/global.d.ts DELETED
@@ -1 +0,0 @@
1
- type Primitive = string | number | bigint | boolean | symbol | null | undefined;