@mana-app/types 0.0.15 → 0.0.16

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.
@@ -113,15 +113,48 @@ export type LinkItem = AdditionalInfoItemBase<AdditionalInfoType.Links> & {
113
113
  };
114
114
  export type TagItem = AdditionalInfoItemBase<AdditionalInfoType.Tags> & Tag;
115
115
  export type AdditionalInfoSectionItem = StaffItem | CharacterItem | SimpleHighlight | LinkItem | TagItem;
116
- export type WithoutType<T extends {
116
+ export type WithoutType<T> = T extends {
117
117
  readonly type: any;
118
- }> = Omit<T, "type">;
119
- export declare function staffItem(input: WithoutType<StaffItem>): StaffItem;
120
- export declare function characterItem(input: WithoutType<CharacterItem>): CharacterItem;
121
- export declare function linkItem(input: WithoutType<LinkItem>): LinkItem;
122
- export declare function tagItem(input: WithoutType<TagItem>): TagItem;
123
- export declare function staffSection(input: WithoutType<StaffSection>): StaffSection;
124
- export declare function highlightsSection(input: WithoutType<HighlightsSection>): HighlightsSection;
125
- export declare function charactersSection(input: WithoutType<CharactersSection>): CharactersSection;
126
- export declare function linksSection(input: WithoutType<LinksSection>): LinksSection;
127
- export declare function tagsSection(input: WithoutType<TagsSection>): TagsSection;
118
+ } ? Omit<T, "type"> : T;
119
+ export declare const staff: {
120
+ item(input: WithoutType<StaffItem>): StaffItem;
121
+ section(input: WithoutType<StaffSection>): StaffSection;
122
+ };
123
+ export declare const highlights: {
124
+ item(input: SimpleHighlight): SimpleHighlight;
125
+ section(input: WithoutType<HighlightsSection>): HighlightsSection;
126
+ };
127
+ export declare const characters: {
128
+ item(input: WithoutType<CharacterItem>): CharacterItem;
129
+ section(input: WithoutType<CharactersSection>): CharactersSection;
130
+ };
131
+ export declare const links: {
132
+ item(input: WithoutType<LinkItem>): LinkItem;
133
+ section(input: WithoutType<LinksSection>): LinksSection;
134
+ };
135
+ export declare const tags: {
136
+ item(input: WithoutType<TagItem>): TagItem;
137
+ section(input: WithoutType<TagsSection>): TagsSection;
138
+ };
139
+ export declare const additionalInfo: {
140
+ staff: {
141
+ item(input: WithoutType<StaffItem>): StaffItem;
142
+ section(input: WithoutType<StaffSection>): StaffSection;
143
+ };
144
+ highlights: {
145
+ item(input: SimpleHighlight): SimpleHighlight;
146
+ section(input: WithoutType<HighlightsSection>): HighlightsSection;
147
+ };
148
+ characters: {
149
+ item(input: WithoutType<CharacterItem>): CharacterItem;
150
+ section(input: WithoutType<CharactersSection>): CharactersSection;
151
+ };
152
+ links: {
153
+ item(input: WithoutType<LinkItem>): LinkItem;
154
+ section(input: WithoutType<LinksSection>): LinksSection;
155
+ };
156
+ tags: {
157
+ item(input: WithoutType<TagItem>): TagItem;
158
+ section(input: WithoutType<TagsSection>): TagsSection;
159
+ };
160
+ };
@@ -1,15 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AdditionalInfoType = void 0;
4
- exports.staffItem = staffItem;
5
- exports.characterItem = characterItem;
6
- exports.linkItem = linkItem;
7
- exports.tagItem = tagItem;
8
- exports.staffSection = staffSection;
9
- exports.highlightsSection = highlightsSection;
10
- exports.charactersSection = charactersSection;
11
- exports.linksSection = linksSection;
12
- exports.tagsSection = tagsSection;
3
+ exports.additionalInfo = exports.tags = exports.links = exports.characters = exports.highlights = exports.staff = exports.AdditionalInfoType = void 0;
13
4
  var AdditionalInfoType;
14
5
  (function (AdditionalInfoType) {
15
6
  AdditionalInfoType[AdditionalInfoType["Staff"] = 1] = "Staff";
@@ -19,30 +10,53 @@ var AdditionalInfoType;
19
10
  AdditionalInfoType[AdditionalInfoType["Tags"] = 5] = "Tags";
20
11
  })(AdditionalInfoType || (exports.AdditionalInfoType = AdditionalInfoType = {}));
21
12
  ;
22
- function staffItem(input) {
23
- return Object.assign({ type: AdditionalInfoType.Staff }, input);
24
- }
25
- function characterItem(input) {
26
- return Object.assign({ type: AdditionalInfoType.Characters }, input);
27
- }
28
- function linkItem(input) {
29
- return Object.assign({ type: AdditionalInfoType.Links }, input);
30
- }
31
- function tagItem(input) {
32
- return Object.assign({ type: AdditionalInfoType.Tags }, input);
33
- }
34
- function staffSection(input) {
35
- return Object.assign({ type: AdditionalInfoType.Staff }, input);
36
- }
37
- function highlightsSection(input) {
38
- return Object.assign({ type: AdditionalInfoType.Highlights }, input);
39
- }
40
- function charactersSection(input) {
41
- return Object.assign({ type: AdditionalInfoType.Characters }, input);
42
- }
43
- function linksSection(input) {
44
- return Object.assign({ type: AdditionalInfoType.Links }, input);
45
- }
46
- function tagsSection(input) {
47
- return Object.assign({ type: AdditionalInfoType.Tags }, input);
48
- }
13
+ function withType(type, input) {
14
+ return Object.assign({ type }, input);
15
+ }
16
+ exports.staff = {
17
+ item(input) {
18
+ return withType(AdditionalInfoType.Staff, input);
19
+ },
20
+ section(input) {
21
+ return withType(AdditionalInfoType.Staff, input);
22
+ },
23
+ };
24
+ exports.highlights = {
25
+ item(input) {
26
+ return input;
27
+ },
28
+ section(input) {
29
+ return withType(AdditionalInfoType.Highlights, input);
30
+ },
31
+ };
32
+ exports.characters = {
33
+ item(input) {
34
+ return withType(AdditionalInfoType.Characters, input);
35
+ },
36
+ section(input) {
37
+ return withType(AdditionalInfoType.Characters, input);
38
+ },
39
+ };
40
+ exports.links = {
41
+ item(input) {
42
+ return withType(AdditionalInfoType.Links, input);
43
+ },
44
+ section(input) {
45
+ return withType(AdditionalInfoType.Links, input);
46
+ },
47
+ };
48
+ exports.tags = {
49
+ item(input) {
50
+ return withType(AdditionalInfoType.Tags, input);
51
+ },
52
+ section(input) {
53
+ return withType(AdditionalInfoType.Tags, input);
54
+ },
55
+ };
56
+ exports.additionalInfo = {
57
+ staff: exports.staff,
58
+ highlights: exports.highlights,
59
+ characters: exports.characters,
60
+ links: exports.links,
61
+ tags: exports.tags,
62
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mana-app/types",
3
- "version": "0.0.15",
3
+ "version": "0.0.16",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {