@e-mc/types 0.10.8 → 0.10.10
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.
- package/README.md +5 -5
- package/constant.d.ts +1 -1
- package/index.js +3 -3
- package/lib/index.d.ts +2 -3
- package/lib/watch.d.ts +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
## Interface
|
|
11
11
|
|
|
12
|
-
* [View Source](https://www.unpkg.com/@e-mc/types@0.10.
|
|
12
|
+
* [View Source](https://www.unpkg.com/@e-mc/types@0.10.10/index.d.ts)
|
|
13
13
|
|
|
14
14
|
```typescript
|
|
15
15
|
import type { LogArguments } from "./lib/logger";
|
|
@@ -197,10 +197,10 @@ const IMPORT_MAP: Record<string, string | undefined>;
|
|
|
197
197
|
|
|
198
198
|
## References
|
|
199
199
|
|
|
200
|
-
- https://www.unpkg.com/@e-mc/types@0.10.
|
|
201
|
-
- https://www.unpkg.com/@e-mc/types@0.10.
|
|
202
|
-
- https://www.unpkg.com/@e-mc/types@0.10.
|
|
203
|
-
- https://www.unpkg.com/@e-mc/types@0.10.
|
|
200
|
+
- https://www.unpkg.com/@e-mc/types@0.10.10/index.d.ts
|
|
201
|
+
- https://www.unpkg.com/@e-mc/types@0.10.10/lib/logger.d.ts
|
|
202
|
+
- https://www.unpkg.com/@e-mc/types@0.10.10/lib/module.d.ts
|
|
203
|
+
- https://www.unpkg.com/@e-mc/types@0.10.10/lib/object.d.ts
|
|
204
204
|
|
|
205
205
|
* https://developer.mozilla.org/en-US/docs/Web/API/DOMException
|
|
206
206
|
* https://www.npmjs.com/package/@types/bytes
|
package/constant.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -269,10 +269,10 @@ function parseStringDefault(value) {
|
|
|
269
269
|
const match = REGEXP_NATIVE.exec(value.trimEnd());
|
|
270
270
|
if (match) {
|
|
271
271
|
try {
|
|
272
|
-
|
|
272
|
+
let text = match[2].trim();
|
|
273
273
|
switch (match[1]) {
|
|
274
274
|
case 'Date':
|
|
275
|
-
return new Date(
|
|
275
|
+
return (text = trimQuote(text)) ? new Date(text) : new Date();
|
|
276
276
|
case 'URL':
|
|
277
277
|
case 'RegExp': {
|
|
278
278
|
const pattern = /^("[^"]+"|'[^']+'|[^\s,]+)(?:\s*,\s*("[^"]+"|'[^']+'|\S+))?$/.exec(text);
|
|
@@ -840,7 +840,7 @@ function alignSize(value, kb = 0, factor = 0) {
|
|
|
840
840
|
}
|
|
841
841
|
if (kb > 0) {
|
|
842
842
|
kb = Math.ceil(kb) * 1024;
|
|
843
|
-
return Math.ceil(result / kb) * kb;
|
|
843
|
+
return Math.ceil(Math.max(result, 1) / kb) * kb;
|
|
844
844
|
}
|
|
845
845
|
return result;
|
|
846
846
|
}
|
package/lib/index.d.ts
CHANGED
|
@@ -106,6 +106,7 @@ declare namespace functions {
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
interface ImageConstructor<T extends IHost = IHost, U extends ImageModule = ImageModule> extends ModuleConstructor {
|
|
109
|
+
/** @deprecated */
|
|
109
110
|
readonly REGEXP_SIZERANGE: RegExp;
|
|
110
111
|
transform<V extends TransformOptions>(file: string, command: string, options?: V): Promise<V extends { tempFile: true } ? string : Null<Buffer>>;
|
|
111
112
|
clamp(value: unknown, min?: number, max?: number): number;
|
|
@@ -256,9 +257,7 @@ declare namespace functions {
|
|
|
256
257
|
|
|
257
258
|
interface DocumentConstructor<T extends IFileManager<U>, U extends ExternalAsset = ExternalAsset, V extends ClientModule = DocumentModule, W extends DocumentComponent = DocumentComponent, X extends DocumentComponentOption = DocumentComponentOption, Y extends ICloud = ICloud<T>> extends ModuleConstructor {
|
|
258
259
|
finalize(this: T, instance: IDocument<T, U, V, W, X, Y>): Promise<unknown>;
|
|
259
|
-
/** @deprecated */
|
|
260
260
|
createSourceMap(code: string, remove: boolean): SourceMap;
|
|
261
|
-
/** @deprecated */
|
|
262
261
|
createSourceMap(code: string, uri?: string, remove?: boolean): SourceMap;
|
|
263
262
|
writeSourceMap(uri: string, data: SourceCode, options?: SourceMapOptions): Undef<string>;
|
|
264
263
|
updateGradle(source: string, namespaces: string[], value: string, upgrade: boolean): string;
|
|
@@ -297,7 +296,7 @@ declare namespace functions {
|
|
|
297
296
|
createServer(port: number, secure?: Null<SecureOptions>, active?: boolean): Null<ws.Server>;
|
|
298
297
|
shutdown(): void;
|
|
299
298
|
setTimeout(value: number | string): void;
|
|
300
|
-
checkTimeout(client: ws): boolean;
|
|
299
|
+
checkTimeout(client: ws.WebSocket): boolean;
|
|
301
300
|
readonly prototype: IWatch<T, U, V, W>;
|
|
302
301
|
new(module?: V): IWatch<T, U, V, W>;
|
|
303
302
|
new(interval?: number, port?: number, securePort?: number, extensions?: unknown[]): IWatch<T, U, V, W>;
|
package/lib/watch.d.ts
CHANGED
|
@@ -58,8 +58,8 @@ export interface IFileGroup<T extends ExternalAsset = ExternalAsset> extends IAb
|
|
|
58
58
|
|
|
59
59
|
export interface FileGroupConstructor<T extends ExternalAsset = ExternalAsset> {
|
|
60
60
|
CONNECTION_TIMEOUT: number;
|
|
61
|
-
CLIENT_SESSION: Map<ws, number>;
|
|
62
|
-
checkTimeout(client: ws): boolean;
|
|
61
|
+
CLIENT_SESSION: Map<ws.WebSocket, number>;
|
|
62
|
+
checkTimeout(client: ws.WebSocket): boolean;
|
|
63
63
|
cloneAsset(asset: T): T;
|
|
64
64
|
readonly prototype: IFileGroup<T>;
|
|
65
65
|
new(uri: string, assets: T[], abortable: boolean): IFileGroup<T>;
|