@mana-app/types 0.0.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.
Files changed (131) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +8 -0
  3. package/dist/index.d.ts +53 -0
  4. package/dist/index.js +18 -0
  5. package/dist/sources/ContentSource/ContentSource.d.ts +48 -0
  6. package/dist/sources/ContentSource/ContentSource.js +2 -0
  7. package/dist/sources/ContentSource/handlers/ChapterEvent.d.ts +16 -0
  8. package/dist/sources/ContentSource/handlers/ChapterEvent.js +2 -0
  9. package/dist/sources/ContentSource/handlers/ContentEvent.d.ts +12 -0
  10. package/dist/sources/ContentSource/handlers/ContentEvent.js +2 -0
  11. package/dist/sources/ContentSource/handlers/ContextMenuHandler.d.ts +9 -0
  12. package/dist/sources/ContentSource/handlers/ContextMenuHandler.js +2 -0
  13. package/dist/sources/ContentSource/handlers/GroupedUpdateProvider.d.ts +9 -0
  14. package/dist/sources/ContentSource/handlers/GroupedUpdateProvider.js +2 -0
  15. package/dist/sources/ContentSource/handlers/ImageRedrawHandler.d.ts +27 -0
  16. package/dist/sources/ContentSource/handlers/ImageRedrawHandler.js +2 -0
  17. package/dist/sources/ContentSource/handlers/LibrarySync.d.ts +8 -0
  18. package/dist/sources/ContentSource/handlers/LibrarySync.js +2 -0
  19. package/dist/sources/ContentSource/handlers/ProgressSync.d.ts +4 -0
  20. package/dist/sources/ContentSource/handlers/ProgressSync.js +2 -0
  21. package/dist/sources/ContentSource/handlers/index.d.ts +7 -0
  22. package/dist/sources/ContentSource/handlers/index.js +23 -0
  23. package/dist/sources/ContentSource/index.d.ts +2 -0
  24. package/dist/sources/ContentSource/index.js +18 -0
  25. package/dist/sources/ContentTracker/AdvancedTracker.d.ts +9 -0
  26. package/dist/sources/ContentTracker/AdvancedTracker.js +2 -0
  27. package/dist/sources/ContentTracker/ContentTracker.d.ts +50 -0
  28. package/dist/sources/ContentTracker/ContentTracker.js +2 -0
  29. package/dist/sources/ContentTracker/index.d.ts +2 -0
  30. package/dist/sources/ContentTracker/index.js +18 -0
  31. package/dist/sources/Source/extensions/Authentication.d.ts +35 -0
  32. package/dist/sources/Source/extensions/Authentication.js +8 -0
  33. package/dist/sources/Source/extensions/DirectoryHandler.d.ts +14 -0
  34. package/dist/sources/Source/extensions/DirectoryHandler.js +2 -0
  35. package/dist/sources/Source/extensions/ImageRequest.d.ts +8 -0
  36. package/dist/sources/Source/extensions/ImageRequest.js +2 -0
  37. package/dist/sources/Source/extensions/PageProvider.d.ts +7 -0
  38. package/dist/sources/Source/extensions/PageProvider.js +2 -0
  39. package/dist/sources/Source/extensions/PageResolver.d.ts +17 -0
  40. package/dist/sources/Source/extensions/PageResolver.js +2 -0
  41. package/dist/sources/Source/extensions/Preferences.d.ts +4 -0
  42. package/dist/sources/Source/extensions/Preferences.js +2 -0
  43. package/dist/sources/Source/extensions/Setup.d.ts +6 -0
  44. package/dist/sources/Source/extensions/Setup.js +2 -0
  45. package/dist/sources/Source/extensions/index.d.ts +7 -0
  46. package/dist/sources/Source/extensions/index.js +23 -0
  47. package/dist/sources/Source/index.d.ts +11 -0
  48. package/dist/sources/Source/index.js +23 -0
  49. package/dist/sources/index.d.ts +3 -0
  50. package/dist/sources/index.js +19 -0
  51. package/dist/types/UI/Form.d.ts +5 -0
  52. package/dist/types/UI/Form.js +2 -0
  53. package/dist/types/UI/UIDefinitions.d.ts +29 -0
  54. package/dist/types/UI/UIDefinitions.js +3 -0
  55. package/dist/types/UI/UIElementBuilders.d.ts +9 -0
  56. package/dist/types/UI/UIElementBuilders.js +18 -0
  57. package/dist/types/UI/UIElements.d.ts +31 -0
  58. package/dist/types/UI/UIElements.js +13 -0
  59. package/dist/types/UI/index.d.ts +4 -0
  60. package/dist/types/UI/index.js +20 -0
  61. package/dist/types/content/BaseItem.d.ts +26 -0
  62. package/dist/types/content/BaseItem.js +2 -0
  63. package/dist/types/content/BooleanState.d.ts +3 -0
  64. package/dist/types/content/BooleanState.js +2 -0
  65. package/dist/types/content/Chapter.d.ts +62 -0
  66. package/dist/types/content/Chapter.js +14 -0
  67. package/dist/types/content/ChapterData.d.ts +16 -0
  68. package/dist/types/content/ChapterData.js +2 -0
  69. package/dist/types/content/Collection.d.ts +24 -0
  70. package/dist/types/content/Collection.js +2 -0
  71. package/dist/types/content/Content.d.ts +59 -0
  72. package/dist/types/content/Content.js +2 -0
  73. package/dist/types/content/ContentProgressState.d.ts +13 -0
  74. package/dist/types/content/ContentProgressState.js +2 -0
  75. package/dist/types/content/ContextMenu.d.ts +14 -0
  76. package/dist/types/content/ContextMenu.js +2 -0
  77. package/dist/types/content/DeepLinkContext.d.ts +8 -0
  78. package/dist/types/content/DeepLinkContext.js +2 -0
  79. package/dist/types/content/Enums.d.ts +22 -0
  80. package/dist/types/content/Enums.js +29 -0
  81. package/dist/types/content/GroupedUpdatesResponse.d.ts +7 -0
  82. package/dist/types/content/GroupedUpdatesResponse.js +2 -0
  83. package/dist/types/content/Highlight.d.ts +36 -0
  84. package/dist/types/content/Highlight.js +2 -0
  85. package/dist/types/content/Property.d.ts +27 -0
  86. package/dist/types/content/Property.js +2 -0
  87. package/dist/types/content/Provider.d.ts +32 -0
  88. package/dist/types/content/Provider.js +10 -0
  89. package/dist/types/content/ReaderContext.d.ts +28 -0
  90. package/dist/types/content/ReaderContext.js +2 -0
  91. package/dist/types/content/index.d.ts +14 -0
  92. package/dist/types/content/index.js +30 -0
  93. package/dist/types/core/Authentication.d.ts +48 -0
  94. package/dist/types/core/Authentication.js +10 -0
  95. package/dist/types/core/ContextProvider.d.ts +6 -0
  96. package/dist/types/core/ContextProvider.js +2 -0
  97. package/dist/types/core/PagedResult.d.ts +17 -0
  98. package/dist/types/core/PagedResult.js +2 -0
  99. package/dist/types/core/SourceInfo.d.ts +81 -0
  100. package/dist/types/core/SourceInfo.js +21 -0
  101. package/dist/types/core/index.d.ts +8 -0
  102. package/dist/types/core/index.js +20 -0
  103. package/dist/types/directory/DirectoryConfig.d.ts +31 -0
  104. package/dist/types/directory/DirectoryConfig.js +2 -0
  105. package/dist/types/directory/DirectoryFilter.d.ts +53 -0
  106. package/dist/types/directory/DirectoryFilter.js +30 -0
  107. package/dist/types/directory/DirectoryRequest.d.ts +37 -0
  108. package/dist/types/directory/DirectoryRequest.js +2 -0
  109. package/dist/types/directory/index.d.ts +3 -0
  110. package/dist/types/directory/index.js +19 -0
  111. package/dist/types/index.d.ts +14 -0
  112. package/dist/types/index.js +26 -0
  113. package/dist/types/networking/Builder.d.ts +88 -0
  114. package/dist/types/networking/Builder.js +120 -0
  115. package/dist/types/networking/Client.d.ts +35 -0
  116. package/dist/types/networking/Client.js +2 -0
  117. package/dist/types/networking/Error.d.ts +13 -0
  118. package/dist/types/networking/Error.js +2 -0
  119. package/dist/types/networking/Request.d.ts +62 -0
  120. package/dist/types/networking/Request.js +16 -0
  121. package/dist/types/networking/Response.d.ts +7 -0
  122. package/dist/types/networking/Response.js +2 -0
  123. package/dist/types/networking/Transformer.d.ts +5 -0
  124. package/dist/types/networking/Transformer.js +2 -0
  125. package/dist/types/networking/index.d.ts +6 -0
  126. package/dist/types/networking/index.js +22 -0
  127. package/dist/types/page/index.d.ts +58 -0
  128. package/dist/types/page/index.js +14 -0
  129. package/dist/types/tracker/index.d.ts +43 -0
  130. package/dist/types/tracker/index.js +12 -0
  131. package/package.json +35 -0
@@ -0,0 +1,120 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NetworkClientBuilder = void 0;
4
+ /**
5
+ * NetworkClientBuilder is a builder class used for creating and configuring instances of NetworkClient.
6
+ * The builder allows you to configure various aspects of the NetworkClient, such as rate limits,
7
+ * request/response transformers (interceptors), headers, cookies, timeout, status validator, and more.
8
+ */
9
+ class NetworkClientBuilder {
10
+ constructor() {
11
+ // Array of functions that transform requests
12
+ this.requestTransformers = [];
13
+ // Array of functions that transform responses
14
+ this.responseTransformers = [];
15
+ // Object representing HTTP headers, where each key-value pair represents a header
16
+ this.headers = {};
17
+ // Array of cookies
18
+ this.cookies = [];
19
+ }
20
+ /**
21
+ * Sets the rate limit for the NetworkClient.
22
+ *
23
+ * @param requests - The maximum number of requests to make per interval.
24
+ * @param interval - The length of the rate limiting interval in seconds.
25
+ * @returns The builder, to allow for method chaining.
26
+ */
27
+ setRateLimit(requests, interval) {
28
+ this.requestsPerSecond = requests / interval;
29
+ return this;
30
+ }
31
+ /**
32
+ * Adds a request interceptor to the NetworkClient.
33
+ *
34
+ * @param transformer - The interceptor to add. This should be a function that takes a request and modifies it in some way.
35
+ * @returns The builder, to allow for method chaining.
36
+ */
37
+ addRequestInterceptor(transformer) {
38
+ this.requestTransformers.push(transformer);
39
+ return this;
40
+ }
41
+ /**
42
+ * Adds a response interceptor to the NetworkClient.
43
+ *
44
+ * @param transformer - The interceptor to add. This should be a function that takes a response and modifies it in some way.
45
+ * @returns The builder, to allow for method chaining.
46
+ */
47
+ addResponseInterceptor(transformer) {
48
+ this.responseTransformers.push(transformer);
49
+ return this;
50
+ }
51
+ /**
52
+ * Sets the authorization token for the NetworkClient.
53
+ *
54
+ * @param token - The token to be included in the Authorization header of every request.
55
+ * @returns The builder, to allow for method chaining.
56
+ */
57
+ setAuthorizationToken(token) {
58
+ return this.addHeader("Authorization", token);
59
+ }
60
+ /**
61
+ * Sets the status validator for the NetworkClient.
62
+ *
63
+ * @param validator - A function that takes a status code and returns true if it is considered successful.
64
+ * @returns The builder, to allow for method chaining.
65
+ */
66
+ setStatusValidator(validator) {
67
+ this.statusValidator = validator;
68
+ return this;
69
+ }
70
+ /**
71
+ * Sets the timeout for requests made by the NetworkClient.
72
+ *
73
+ * @param timeout - The maximum time to wait for a request to complete, in milliseconds.
74
+ * @returns The builder, to allow for method chaining.
75
+ */
76
+ setTimeout(timeout) {
77
+ this.timeout = timeout;
78
+ return this;
79
+ }
80
+ /**
81
+ * Sets the maximum number of retries for this request by the NetworkClient.
82
+ *
83
+ * @param retries - The maximum number of retries for this request
84
+ * @returns The builder, to allow for method chaining.
85
+ */
86
+ setMaxRetries(retries) {
87
+ this.maxRetries = retries;
88
+ return this;
89
+ }
90
+ /**
91
+ * Sets a header for the NetworkClient.
92
+ *
93
+ * @param key - The name of the header
94
+ * @param value - The value of the header
95
+ * @returns The builder, to allow for method chaining.
96
+ */
97
+ addHeader(key, value) {
98
+ this.headers[key] = value;
99
+ return this;
100
+ }
101
+ /**
102
+ * Sets a cookie for the NetworkClient.
103
+ *
104
+ * @param cookie - The cookie to be included in every request.
105
+ * @returns The builder, to allow for method chaining.
106
+ */
107
+ addCookie(cookie) {
108
+ this.cookies.push(cookie);
109
+ return this;
110
+ }
111
+ /**
112
+ * Builds a NetworkClient using the parameters set on the builder.
113
+ *
114
+ * @returns A NetworkClient with the configured parameters.
115
+ */
116
+ build() {
117
+ return new NetworkClient(this);
118
+ }
119
+ }
120
+ exports.NetworkClientBuilder = NetworkClientBuilder;
@@ -0,0 +1,35 @@
1
+ import { NetworkClientBuilder } from "./Builder";
2
+ import { NetworkRequestConfig, NetworkRequest } from "./Request";
3
+ import { NetworkResponse } from "./Response";
4
+ declare global {
5
+ /**
6
+ * NetworkClient is responsible for making HTTP requests.
7
+ * It supports GET, POST, and custom requests.
8
+ */
9
+ class NetworkClient {
10
+ constructor(builder?: NetworkClientBuilder);
11
+ /**
12
+ * Makes a POST request to the specified URL.
13
+ *
14
+ * @param url - The URL to send the request to.
15
+ * @param config - Optional configuration for the request.
16
+ * @returns A Promise that resolves to the response.
17
+ */
18
+ post(url: string, config?: NetworkRequestConfig): Promise<NetworkResponse>;
19
+ /**
20
+ * Makes a GET request to the specified URL.
21
+ *
22
+ * @param url - The URL to send the request to.
23
+ * @param config - Optional configuration for the request.
24
+ * @returns A Promise that resolves to the response.
25
+ */
26
+ get(url: string, config?: NetworkRequestConfig): Promise<NetworkResponse>;
27
+ /**
28
+ * Makes a custom HTTP request.
29
+ *
30
+ * @param req - The details of the request to make.
31
+ * @returns A Promise that resolves to the response.
32
+ */
33
+ request(req: NetworkRequest): Promise<NetworkResponse>;
34
+ }
35
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,13 @@
1
+ import { NetworkRequest } from "./Request";
2
+ import { NetworkResponse } from "./Response";
3
+ declare global {
4
+ class NetworkError extends Error {
5
+ req: NetworkRequest;
6
+ res: NetworkResponse;
7
+ constructor(name: string, message: string, req: NetworkRequest, res: NetworkResponse);
8
+ }
9
+ class CloudflareError extends Error {
10
+ constructor(resolutionURL?: string);
11
+ resolutionURL?: string;
12
+ }
13
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,62 @@
1
+ import { NetworkRequestTransformer, NetworkResponseTransformer } from "./Transformer";
2
+ type RequestMethod = "GET" | "DELETE" | "HEAD" | "OPTIONS" | "POST" | "PUT" | "PATCH" | "PURGE" | "LINK" | "UNLINK";
3
+ type RequestHeaders = Record<string, string | number | boolean>;
4
+ export type Cookie = {
5
+ name: string;
6
+ value: string;
7
+ };
8
+ export type BasicURL = {
9
+ url: string;
10
+ params?: Record<string, any>;
11
+ };
12
+ export type NetworkRequest = {
13
+ /** The URL where the request will be sent. */
14
+ url: string;
15
+ /**
16
+ * The HTTP method for the request. This is a string that can be one of several
17
+ * standard HTTP methods (like "GET", "POST", "PUT", etc.) or a custom method.
18
+ * When this property is not specified, it defaults to a GET request.
19
+ */
20
+ method?: RequestMethod | string;
21
+ /** An object representing any parameters to be included in the URL of the request. These will be formatted as query parameters. */
22
+ params?: Record<string, any>;
23
+ /**
24
+ * An object representing the body of the request. Depending on the Content-Type header,
25
+ * this can either be send as a JSON object (for application/json) or a URL-encoded string (for application/x-www-form-urlencoded).
26
+ */
27
+ body?: any;
28
+ /** An object representing any additional headers to be included in the request. */
29
+ headers?: RequestHeaders;
30
+ /** An array of cookies to be included in the request. */
31
+ cookies?: Cookie[];
32
+ /** The maximum time to wait for the request to complete, in milliseconds. If the request takes longer than this, it will be aborted. */
33
+ timeout?: number;
34
+ /** The maximum number of times to retry the request if it fails. After this many failures, the request will not be retried again. */
35
+ maxRetries?: number;
36
+ /**
37
+ * A function or array of functions that transform the request before it is sent.
38
+ * Each function takes a NetworkRequest and returns a transformed NetworkRequest.
39
+ */
40
+ transformRequest?: NetworkRequestTransformer | NetworkRequestTransformer[];
41
+ /**
42
+ * A function or array of functions that transform the response after it is received.
43
+ * Each function takes a NetworkResponse and returns a transformed NetworkResponse.
44
+ */
45
+ transformResponse?: NetworkResponseTransformer | NetworkResponseTransformer[];
46
+ /**
47
+ * A function that determines whether a given status code is considered successful.
48
+ * This function takes a status code as input and returns true if the status code is
49
+ * considered a success status, and false otherwise.
50
+ */
51
+ validateStatus?: (s: number) => boolean;
52
+ };
53
+ /**
54
+ * NetworkRequestConfig is a type that represents the configuration for a NetworkRequest. It's
55
+ the same as NetworkRequest, but without the "url" and "method" properties. This is typically
56
+ used when the URL and method are provided separately from the rest of the configuration. e.g the `NetworkClient.post` & `NetworkClient.get` methods
57
+ */
58
+ export type NetworkRequestConfig = Omit<NetworkRequest, "url" | "method">;
59
+ export declare const name: (base: RequestHeaders, known?: RequestHeaders) => Promise<{
60
+ [x: string]: string | number | boolean;
61
+ }>;
62
+ export {};
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.name = void 0;
13
+ const name = (base, known) => __awaiter(void 0, void 0, void 0, function* () {
14
+ return Object.assign(Object.assign({}, base), known);
15
+ });
16
+ exports.name = name;
@@ -0,0 +1,7 @@
1
+ import { NetworkRequest } from "./Request";
2
+ export type NetworkResponse = {
3
+ data: string;
4
+ status: number;
5
+ headers: Record<string, any>;
6
+ request: NetworkRequest;
7
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ import { NetworkRequest } from "./Request";
2
+ import { NetworkResponse } from "./Response";
3
+ export type Transformer<T> = (v: T) => Promise<T>;
4
+ export type NetworkRequestTransformer = Transformer<NetworkRequest>;
5
+ export type NetworkResponseTransformer = Transformer<NetworkResponse>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ export * from "./Builder";
2
+ export * from "./Client";
3
+ export * from "./Request";
4
+ export * from "./Response";
5
+ export * from "./Transformer";
6
+ export * from "./Error";
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./Builder"), exports);
18
+ __exportStar(require("./Client"), exports);
19
+ __exportStar(require("./Request"), exports);
20
+ __exportStar(require("./Response"), exports);
21
+ __exportStar(require("./Transformer"), exports);
22
+ __exportStar(require("./Error"), exports);
@@ -0,0 +1,58 @@
1
+ import { Badge, ContextProvider, Either, Highlight } from "..";
2
+ import { DirectoryRequest } from "../directory";
3
+ /**
4
+ * This object defines what page suwatte links to
5
+ *
6
+ * If DirectoryRequest is provided, A DirectoryView is presented, otherwise it navigates to another page
7
+ */
8
+ export type Linkable = Either<{
9
+ page: PageLink;
10
+ }, {
11
+ request: DirectoryRequest;
12
+ }>;
13
+ export type PageLink = ContextProvider & {
14
+ id: "home" | string;
15
+ };
16
+ export type PageLinkLabel = {
17
+ /**
18
+ * The label of this link
19
+ */
20
+ title: string;
21
+ subtitle?: string;
22
+ badge?: Badge;
23
+ /**
24
+ * When a link is being displayed in a page section,use this to set the thumbnail to appear
25
+ */
26
+ cover?: string;
27
+ /**
28
+ * The actual Link of the label, it should either be a PageLink pointing to a page to be navigated to OR a directory request to display a directory layout for
29
+ */
30
+ link: Linkable;
31
+ };
32
+ export declare enum SectionStyle {
33
+ DEFAULT = 0,
34
+ INFO = 1,
35
+ GALLERY = 2,
36
+ NAVIGATION_LIST = 3,
37
+ ITEM_LIST = 4,
38
+ PADDED_LIST = 5,
39
+ TAG = 6,
40
+ STANDARD_GRID = 7
41
+ }
42
+ /**
43
+ * This defines a section within the page, if the `items` property is populated, the `resolvePageSection` will not be called as the section is treated as resolved
44
+ */
45
+ export type PageSection = {
46
+ id: string;
47
+ title: string;
48
+ subtitle?: string;
49
+ viewMoreLink?: Linkable;
50
+ items?: Highlight[];
51
+ style?: SectionStyle;
52
+ };
53
+ export type ResolvedPageSection = {
54
+ items: Highlight[];
55
+ viewMoreLink?: Linkable;
56
+ updatedTitle?: string;
57
+ updatedSubtitle?: string;
58
+ };
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SectionStyle = void 0;
4
+ var SectionStyle;
5
+ (function (SectionStyle) {
6
+ SectionStyle[SectionStyle["DEFAULT"] = 0] = "DEFAULT";
7
+ SectionStyle[SectionStyle["INFO"] = 1] = "INFO";
8
+ SectionStyle[SectionStyle["GALLERY"] = 2] = "GALLERY";
9
+ SectionStyle[SectionStyle["NAVIGATION_LIST"] = 3] = "NAVIGATION_LIST";
10
+ SectionStyle[SectionStyle["ITEM_LIST"] = 4] = "ITEM_LIST";
11
+ SectionStyle[SectionStyle["PADDED_LIST"] = 5] = "PADDED_LIST";
12
+ SectionStyle[SectionStyle["TAG"] = 6] = "TAG";
13
+ SectionStyle[SectionStyle["STANDARD_GRID"] = 7] = "STANDARD_GRID";
14
+ })(SectionStyle || (exports.SectionStyle = SectionStyle = {}));
@@ -0,0 +1,43 @@
1
+ import { Highlight, Property } from "../content";
2
+ import { PublicationStatus } from "../content/Enums";
3
+ export declare enum TrackStatus {
4
+ READING = "READING",
5
+ PLANNING = "PLANNING",
6
+ COMPLETED = "COMPLETED",
7
+ PAUSED = "PAUSED",
8
+ DROPPED = "DROPPED",
9
+ REREADING = "REREADING"
10
+ }
11
+ export type TrackProgress = {
12
+ lastReadChapter: number;
13
+ maxAvailableChapter?: number;
14
+ lastReadVolume?: number;
15
+ };
16
+ export type TrackProgressUpdate = {
17
+ chapter?: number;
18
+ volume?: number;
19
+ };
20
+ export type TrackEntry = {
21
+ status: TrackStatus;
22
+ progress: TrackProgress;
23
+ };
24
+ export type FullTrackItem = Highlight & {
25
+ summary?: string;
26
+ properties?: Property[];
27
+ bannerCover?: string;
28
+ isFavorite?: boolean;
29
+ relatedTitles?: Highlight[];
30
+ recommendedTitles?: Highlight[];
31
+ links?: {
32
+ title: string;
33
+ url: string;
34
+ }[];
35
+ characters?: {
36
+ name: string;
37
+ role?: string;
38
+ image?: string;
39
+ summary?: string;
40
+ }[];
41
+ additionalTitles?: string[];
42
+ status?: PublicationStatus;
43
+ };
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TrackStatus = void 0;
4
+ var TrackStatus;
5
+ (function (TrackStatus) {
6
+ TrackStatus["READING"] = "READING";
7
+ TrackStatus["PLANNING"] = "PLANNING";
8
+ TrackStatus["COMPLETED"] = "COMPLETED";
9
+ TrackStatus["PAUSED"] = "PAUSED";
10
+ TrackStatus["DROPPED"] = "DROPPED";
11
+ TrackStatus["REREADING"] = "REREADING";
12
+ })(TrackStatus || (exports.TrackStatus = TrackStatus = {}));
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@mana-app/types",
3
+ "version": "0.0.1",
4
+ "main": "dist/index.js",
5
+ "types": "dist/index.d.ts",
6
+ "scripts": {
7
+ "build": "rm -rf ./dist && tsc",
8
+ "check:circular": "dpdm ."
9
+ },
10
+ "devDependencies": {
11
+ "@types/node": "^20.11.30",
12
+ "@typescript-eslint/eslint-plugin": "^7.3.1",
13
+ "dpdm": "^3.14.0",
14
+ "eslint": "^8.57.0",
15
+ "prettier": "^3.2.5",
16
+ "typescript": "^5.4.3"
17
+ },
18
+ "keywords": [
19
+ "mana"
20
+ ],
21
+ "author": {
22
+ "name": "Seyden",
23
+ "email": "saiifii@live.de",
24
+ "url": "https://github.com/Seyden"
25
+ },
26
+ "license": "MIT",
27
+ "description": "Types & Interfaces for Mana’s JavaScriptCore and WebKit environment.",
28
+ "files": [
29
+ "/dist"
30
+ ],
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "https://github.com/Mana-iOS/types.git"
34
+ }
35
+ }