Skip to content

Commit

Permalink
Adjusted ConceptCreator type
Browse files Browse the repository at this point in the history
  • Loading branch information
REllEK-IO committed Oct 10, 2023
1 parent 4967552 commit 9cba93d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/concepts/counter/counter.concept.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { addQuality } from './qualities/add.quality';
import { subtractQuality } from './qualities/subtract.quality';
import { setCountQuality } from './qualities/setCount.quality';
import { createConcept } from '../../model/concept';
import { ConceptCreator, createConcept } from '../../model/concept';
export { countingStrategy, primedCountingStrategy } from './strategies/counting.strategy';

export type Counter = {
Expand All @@ -14,7 +14,7 @@ const initialCounterState: Counter = {
count: 0
};

export const createCounterConcept = () => {
export const createCounterConcept: ConceptCreator = () => {
return createConcept(
counterName,
initialCounterState,
Expand Down
4 changes: 2 additions & 2 deletions src/concepts/experiment/experiment.concept.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createConcept } from '../../model/concept';
import { ConceptCreator, createConcept } from '../../model/concept';
import { Action } from '../../model/action';
import { checkInQuality } from './qualities/checkIn.quality';
import { experimentPrinciple } from './experiment.principle';
Expand All @@ -15,7 +15,7 @@ const createExperimentState = (): ExperimentState => {
};
};

export const createExperimentConcept = () => {
export const createExperimentConcept: ConceptCreator = () => {
return createConcept(
experimentName,
createExperimentState(),
Expand Down
4 changes: 2 additions & 2 deletions src/concepts/ownership/ownership.concept.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createConcept } from '../../model/concept';
import { ConceptCreator, createConcept } from '../../model/concept';
import { Action } from '../../model/action';
import { ownershipMode } from './ownership.mode';
import { initializeOwnershipQuality } from './qualities/initializeOwnership.quality';
Expand Down Expand Up @@ -31,7 +31,7 @@ const createOwnershipState = (isResponsibleForMode?: boolean): OwnershipState =>
};
};

export const createOwnershipConcept = (isResponsibleForMode?: boolean) => {
export const createOwnershipConcept: ConceptCreator = (isResponsibleForMode?: boolean) => {
return createConcept(
ownershipName,
createOwnershipState(isResponsibleForMode ? isResponsibleForMode : true),
Expand Down
14 changes: 8 additions & 6 deletions src/model/concept.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,14 @@ export type Concept = {
};

export type ConceptCreator = (
name?: string,
state?: unknown,
qualities?: Quality[],
principles?: PrincipleFunction[],
mode?: Mode[],
meta?: Record<string,unknown>
// eslint-disable-next-line @typescript-eslint/no-explicit-any
...args: any[]
// name?: string,
// state?: unknown,
// qualities?: Quality[],
// principles?: PrincipleFunction[],
// mode?: Mode[],
// meta?: Record<string,unknown>
) => Concept;

export function createConcept(
Expand Down

0 comments on commit 9cba93d

Please sign in to comment.