Skip to content

Commit

Permalink
feat: implemented the i18 interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
kurone-kito committed Apr 23, 2021
1 parent d0eb33a commit 2dc004c
Showing 1 changed file with 79 additions and 5 deletions.
84 changes: 79 additions & 5 deletions packages/dantalion-i18n/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,81 @@
import type { Genius } from '@kurone-kito/dantalion-core';
import type { PersonalityType } from './resources/types';
import getResourcesAccessor from './resources';
import type {
Brain,
Communication,
Genius,
Management,
Motivation,
Position,
Response,
Vector,
} from '@kurone-kito/dantalion-core';
import type {
DetailsType,
PersonalityType,
VectorType,
} from './resources/types';
import getResourcesAccessor, { ResourcesAccessor } from './resources';
import getResourcesAsync from './resources/t';

export const getGeniusAsync = getResourcesAccessor<PersonalityType, Genius>(
'genius'
export type {
DetailsBaseType,
DetailsType,
PersonalityType,
VectorType,
} from './resources/types';
export type { ResourcesAccessor } from './resources';

/**
* The instance provides a set of functions that retrieve
* human-readable resources related to the thought method.
*/
export const brain = getResourcesAccessor<DetailsType, Brain>('brain');

/**
* The instance provides a set of functions that retrieve
* human-readable resources related to dialogue policy.
*/
export const communication = getResourcesAccessor<DetailsType, Communication>(
'communication'
);

/**
* The instance provides a set of functions that retrieve
* human-readable resources related to natural personality.
*/
export const genius = getResourcesAccessor<PersonalityType, Genius>('genius');

/**
* The instance provides a set of functions that retrieve human-readable
* resources related to risk and return thinking in specific people.
*/
export const management = getResourcesAccessor<DetailsType, Management>(
'management'
);

/**
* The instance provides a set of functions that retrieve human-readable
* resources related to an environment that is easy to get motivated.
*/
export const motivation: ResourcesAccessor<string, Motivation> = {
getAsync: async (key) => (await getResourcesAsync())(`motivation.${key}`),
getCategoryDetailAsync: async () =>
(await getResourcesAsync())('motivation.detail'),
};

/**
* The instance provides a set of functions that retrieve
* human-readable resources related to a talented role.
*/
export const position = getResourcesAccessor<DetailsType, Position>('position');

/**
* The instance provides a set of functions that retrieve
* human-readable resources related to on-site or behind.
*/
export const response = getResourcesAccessor<DetailsType, Response>('response');

/**
* The instance provides a set of functions that retrieve human-readable
* resources related to the major classification of personality.
*/
export const vector = getResourcesAccessor<VectorType, Vector>('vector');

0 comments on commit 2dc004c

Please sign in to comment.