Skip to content

Commit

Permalink
clean up some old code
Browse files Browse the repository at this point in the history
  • Loading branch information
rsek committed Jan 17, 2024
1 parent be55555 commit 9729bab
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 13 deletions.
1 change: 0 additions & 1 deletion pkg/nodejs/@datasworn/core/dist/Id/TypeMaps.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ exports.NamesByTypeComposite = {
site_themes: 'DelveSiteTheme',
truths: 'Truth'
};
// type NameFromTypeComposite<T extends AnyTypeComposite> =
exports.NamesByCollectionSubtype = {
assets: 'AssetCollection',
atlas: 'Atlas',
Expand Down
2 changes: 1 addition & 1 deletion pkg/nodejs/@datasworn/core/dist/Id/Utils.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export type TypeForTypeElements<Type extends IdElements.TypeElements.AnyPrimary,
export type TypeForTypeKeys<T extends AnyTypeKeys> = TypesByName[NameFromTypeKeys<T>];
type NameFromCollectionSubtype<T extends IdElements.TypeElements.Collectable.Any> = NameForTypeComposite<`${IdElements.TypeElements.Collection}/${T}`>;
type NameFromTypeKeys<T extends AnyTypeKeys> = T extends [
infer Type extends IdElements.TypeElements.Collection,
IdElements.TypeElements.Collection,
infer Subtype extends IdElements.TypeElements.Collectable.Any
] ? NameFromCollectionSubtype<Subtype> : T extends [
infer U extends IdElements.TypeElements.Collectable.Any | IdElements.TypeElements.NonCollectable
Expand Down
10 changes: 5 additions & 5 deletions src/pkg-core/Id/Strings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export type RecursiveCollectableId<
AncestorKeys extends CollectionPathKeys = CollectionPathKeys,
Key extends string = string
> = Id<RulesPackage, [Type], [...AncestorKeys, Key]>
type AtlasEntryId = RecursiveCollectableId<string, 'atlas'>
type _AtlasEntryId = RecursiveCollectableId<string, 'atlas'>

export type CollectableId<
RulesPackage extends RulesPackageId = RulesPackageId,
Expand All @@ -75,7 +75,7 @@ export type NonRecursiveCollectableId<
ParentKey extends DictKey = DictKey,
Key extends DictKey = DictKey
> = CollectableId<RulesPackage, Type, [ParentKey], Key>
type AssetId = NonRecursiveCollectableId<string, 'moves'>
type _AssetId = NonRecursiveCollectableId<string, 'moves'>

// `${RulesPackage}${IdElements.CONST.Sep}${Type}${IdElements.CONST.Sep}${DictKey}${IdElements.CONST.Sep}${Key}`

Expand All @@ -101,7 +101,7 @@ export type RecursiveCollectionId<
Key extends string = string
> = CollectionId<RulesPackage, Subtype, AncestorKeys, Key>

type AtlasId = RecursiveCollectionId<string, 'atlas'>
type _AtlasId = RecursiveCollectionId<string, 'atlas'>

// `${RulesPackage}${IdElements.CONST.Sep}${IdElements.TypeElements.Collection}${IdElements.CONST.Sep}${Subtype}${IdElements.CONST.Sep}${RecursiveCollectionKeysString}`
export type NonRecursiveCollectionId<
Expand All @@ -111,7 +111,7 @@ export type NonRecursiveCollectionId<
Key extends DictKey = DictKey
> = CollectionId<RulesPackage, Subtype, [], Key>

type AssetCollectionId = NonRecursiveCollectionId<string, 'moves'>
type _AssetCollectionId = NonRecursiveCollectionId<string, 'moves'>

// `${RulesPackage}${IdElements.CONST.Sep}${IdElements.TypeElements.Collection}${IdElements.CONST.Sep}${Subtype}${IdElements.CONST.Sep}${Key}`

Expand All @@ -122,7 +122,7 @@ export type NonCollectableId<
Key extends DictKey = DictKey
> = Id<RulesPackage, [Type], [Key]>

type TruthId = NonCollectableId<string, 'truths'>
type _TruthId = NonCollectableId<string, 'truths'>

// `${RulesPackage}${IdElements.CONST.Sep}${Type}${IdElements.CONST.Sep}${Key}`

Expand Down
1 change: 0 additions & 1 deletion src/pkg-core/Id/TypeMaps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ export interface IdsByTypeName extends Record<AnyTypeName, Id.AnyId> {

export type IdForTypeName<T extends AnyTypeName> = IdsByTypeName[T]

// type NameFromTypeComposite<T extends AnyTypeComposite> =

export const NamesByCollectionSubtype = {
assets: 'AssetCollection',
Expand Down
9 changes: 4 additions & 5 deletions src/pkg-core/Id/Utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,12 +311,12 @@ type NameFromCollectionSubtype<
T extends IdElements.TypeElements.Collectable.Any
> = NameForTypeComposite<`${IdElements.TypeElements.Collection}/${T}`>

type CollectionTypeFromSubtype<
type _CollectionTypeFromSubtype<
T extends IdElements.TypeElements.Collectable.Any
> = TypesByName[NameFromCollectionSubtype<T>]

type NameFromTypeKeys<T extends AnyTypeKeys> = T extends [
infer Type extends IdElements.TypeElements.Collection,
IdElements.TypeElements.Collection,
infer Subtype extends IdElements.TypeElements.Collectable.Any
]
? NameFromCollectionSubtype<Subtype>
Expand All @@ -328,7 +328,7 @@ type NameFromTypeKeys<T extends AnyTypeKeys> = T extends [
? NameForTypeComposite<U>
: never

type f = NameFromTypeKeys<['delve_sites']>
type _f = NameFromTypeKeys<['delve_sites']>

export type ExtractParentCollectionKey<
T extends Strings.NonRecursiveCollectableId
Expand Down Expand Up @@ -449,8 +449,7 @@ export type DropLast<T extends unknown[]> = T extends [T[number]]
? U
: never


type fff = ExtractAncestorPathElements<'sundered_isles/oracles/core/action'>
type _fff = ExtractAncestorPathElements<'sundered_isles/oracles/core/action'>

export type {
AnyCollectionType as AnyCollection,
Expand Down

0 comments on commit 9729bab

Please sign in to comment.