Socket
Socket
Sign inDemoInstall

@squared-functions/types

Package Overview
Dependencies
Maintainers
1
Versions
367
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@squared-functions/types - npm Package Compare versions

Comparing version 4.9.8 to 4.9.9

8

index.d.ts

@@ -213,6 +213,6 @@ /// <reference path="./lib/type.d.ts" />

const WATCH_EVENT: {
MODIFIED: string;
BROADCAST: string;
CLOSE: string;
ERROR: string;
MODIFIED: "modified";
BROADCAST: "broadcast";
CLOSE: "close";
ERROR: "error";
};

@@ -219,0 +219,0 @@

@@ -17,3 +17,3 @@ /* eslint @typescript-eslint/no-explicit-any: "off" */

import type { CommandData, CropData, ICommand, QualityData, ResizeData, RotateData, TransformOptions } from './image';
import type { ExecCommand, LOG_TYPE, LogArguments, LogComponent, LogDate, LogFailOptions, LogMessageOptions, LogOptions, LogProcessOptions, LogTime, LogType, LogValue, ModuleFormatMessageMethod, ModuleWriteFailMethod, STATUS_TYPE, StatusType } from './logger';
import type { ExecCommand, LOG_TYPE, LogArguments, LogComponent, LogDate, LogFailOptions, LogMessageOptions, LogOptions, LogProcessOptions, LogTime, LogType, LogValue, STATUS_TYPE, StatusType } from './logger';
import type { AsHashOptions, CheckSemVerOptions, CloneObjectOptions, CopyDirOptions, CopyDirResult, CopyFileOptions, CreateDirOptions, DeleteFileOptions, GetFunctionsOptions, GetTempDirOptions, MoveFileOptions, NormalizeFlags, ParseFunctionOptions, PermissionOptions, ProtocolType, ReadFileCallback, ReadFileOptions, RemoveDirOptions, WriteFileOptions } from './module';

@@ -25,4 +25,2 @@ import type { RequestData, Settings } from './node';

import type { DOWNLOAD_TYPE, FILE_TYPE } from '../index';
import type { NoParamCallback, WriteStream } from 'fs';

@@ -47,4 +45,2 @@ import type { SpawnOptions } from 'child_process';

type BufferView = BufferContent | NodeJS.ArrayBufferView;
type ModuleSupportedMethod = (major: number, minor?: number, patch?: number, lts?: boolean) => boolean;
type AllSettledMethod = <T>(values: readonly (T | PromiseLike<T>)[], rejected?: LogValue, options?: LogFailOptions | LogType) => Promise<PromiseSettledResult<T>[]>;
type CpuUsage = NodeJS.CpuUsage;

@@ -88,5 +84,5 @@

interface CompressConstructor extends ModuleConstructor {
readonly prototype: ICompress<CompressModule>;
new(module?: CompressModule): ICompress<CompressModule>;
interface CompressConstructor<T extends CompressModule<U> = CompressModule<any>, U extends CompressSettings = CompressSettings> extends ModuleConstructor {
readonly prototype: ICompress<T, U>;
new(module?: U): ICompress<T, U>;
}

@@ -117,2 +113,3 @@

qualityData?: QualityData;
methodData?: [string, unknown[]?][];
opacityValue: number;

@@ -133,7 +130,7 @@ readonly instance: unknown;

interface ImageV3Constructor<T extends IHost = IHost, U extends IImageV3<T> = IImageV3<T>> extends ImageV1Constructor<T> {
using<V extends ExternalAsset>(this: T, instance: U, data: IFileThread<V>, command: string): Promise<unknown>;
interface ImageV3Constructor<T extends IHost = IHost, U extends ImageModule = ImageModule> extends ImageV1Constructor<T, IImageV3<T, U>> {
using<W extends ExternalAsset>(this: T, instance: IImageV3<T, U>, data: IFileThread<W>, command: string): Promise<unknown>;
transform(file: BufferOfURI, command: string, options?: TransformOptions): Promise<Null<Buffer> | string>;
readonly prototype: U;
new(module?: ImageModule): U;
readonly prototype: IImageV3<T, U>;
new(module?: U): IImageV3<T, U>;
}

@@ -151,7 +148,7 @@

interface TaskConstructor<T extends IHost = IHost, U extends ITask<T> = ITask<T>> extends ModuleConstructor {
finalize<V extends ExternalAsset>(this: T, instance: U, assets: V[]): Promise<unknown>;
using?<V extends ExternalAsset>(this: T, instance: U, assets: V[], preceding?: boolean): Promise<unknown>;
readonly prototype: U;
new(module?: TaskModule, ...args: unknown[]): U;
interface TaskConstructor<T extends IHost = IHost, U extends TaskModule = TaskModule> extends ModuleConstructor {
finalize<V extends ExternalAsset>(this: T, instance: ITask<T, U>, assets: V[]): Promise<unknown>;
using?<V extends ExternalAsset>(this: T, instance: ITask<T, U>, assets: V[], preceding?: boolean): Promise<unknown>;
readonly prototype: ITask<T, U>;
new(module?: U, ...args: unknown[]): ITask<T, U>;
}

@@ -190,7 +187,7 @@

interface DbConstructor<T extends IHost = IHost, U extends IDb<T> = IDb<T>> extends ClientDbConstructor<T> {
interface DbConstructor<T extends IHost = IHost, U extends DbModule = DbModule, V extends DbDataSource = DbDataSource> extends ClientDbConstructor<T> {
setPoolConfig(value: ObjectMap<PoolConfig>): void;
getPoolConfig(source: string): Undef<Required<PoolConfig>>;
readonly prototype: U;
new(module?: DbModule, database?: DataSource[], ...args: unknown[]): U;
readonly prototype: IDb<T, U, V>;
new(module?: U, database?: V[], ...args: unknown[]): IDb<T, U, V>;
}

@@ -238,3 +235,3 @@

interface CloudConstructor<T extends IHost = IHost, U extends ICloud<T> = ICloud<T>> extends ClientDbConstructor<T> {
interface CloudConstructor<T extends IHost = IHost, U extends CloudModule = CloudModule, V extends CloudDatabase = CloudDatabase> extends ClientDbConstructor<T> {
LOG_CLOUD_FAIL: LogMessageOptions;

@@ -247,11 +244,11 @@ LOG_CLOUD_COMMAND: LogMessageOptions;

LOG_CLOUD_DELAYED: LogMessageOptions;
finalize(this: T, instance: U): Promise<unknown>;
uploadAsset<V extends IFileManager<W>, W extends ExternalAsset>(state: IScopeOrigin<V, ICloud<V>>, file: W, ignoreProcess: boolean): Promise<unknown>;
uploadAsset<V extends IFileManager<W>, W extends ExternalAsset>(state: IScopeOrigin<V, ICloud<V>>, file: W, contentType?: string, ignoreProcess?: boolean): Promise<unknown>;
sanitizeAssets<V extends ExternalAsset>(assets: V[]): V[];
readonly prototype: U;
new(module?: CloudModule, database?: CloudDatabase[], ...args: unknown[]): U;
finalize(this: T, instance: ICloud<T, U, V>): Promise<unknown>;
uploadAsset<W extends IFileManager<X>, X extends ExternalAsset>(state: IScopeOrigin<W, ICloud<W>>, file: X, ignoreProcess: boolean): Promise<unknown>[];
uploadAsset<W extends IFileManager<X>, X extends ExternalAsset>(state: IScopeOrigin<W, ICloud<W>>, file: X, contentType?: string, ignoreProcess?: boolean): Promise<unknown>[];
sanitizeAssets<W extends ExternalAsset>(assets: W[]): W[];
readonly prototype: ICloud<T, U, V>;
new(module?: U, database?: CloudDatabase[], ...args: unknown[]): ICloud<T, U, V>;
}
interface IDocument<T extends IFileManager<U>, U extends ExternalAsset = ExternalAsset, V extends ClientModule = DocumentModule, W extends DocumentComponent = DocumentComponent, X extends DocumentComponentOption = DocumentComponentOption, Y extends ICloud = ICloud> extends IClient<T, V, TransformCallback<T, U>> {
interface IDocument<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 IClient<T, V, TransformCallback<T, U>> {
Db: Null<IDb>;

@@ -292,3 +289,3 @@ assets: U[];

watchInit?(watch: IFileGroup<U>, assets: U[], sanitize?: boolean): Undef<WatchInitResult>;
watchModified?: ModifiedPostFinalizeListener<U>;
watchModified?(server: Null<ws.Server> | IFileGroup<U>, watch?: IFileGroup<U> | U[], assets?: U[]): PostFinalizeCallback;
set dataSource(value: DataSource[]);

@@ -299,4 +296,4 @@ get dataSource(): DataSource[];

interface DocumentConstructor<T extends IFileManager<U>, U extends ExternalAsset = ExternalAsset, V extends IDocument<T, U> = IDocument<T, U>> extends ModuleConstructor {
finalize(this: T, instance: V): Promise<unknown>;
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 {
finalize(this: T, instance: IDocument<T, U, V, W, X, Y>): Promise<unknown>;
createSourceMap(code: string, remove: boolean): SourceMap;

@@ -307,7 +304,7 @@ createSourceMap(code: string, uri?: string, remove?: boolean): SourceMap;

generateLintTable(messages: LintMessage[], options: GenerateLintTableOptions): LogComponent[];
using?(this: T, instance: V, file: U): Promise<unknown>;
cleanup?(this: T, instance: V): Promise<unknown>;
using?(this: T, instance: IDocument<T, U, V, W, X, Y>, file: U): Promise<unknown>;
cleanup?(this: T, instance: IDocument<T, U, V, W, X, Y>): Promise<unknown>;
sanitizeAssets?(assets: U[], exclusions?: U[]): U[];
readonly prototype: V;
new(module?: DocumentModule, ...args: unknown[]): V;
readonly prototype: IDocument<T, U, V, W, X, Y>;
new(module?: V, ...args: unknown[]): IDocument<T, U, V, W, X, Y>;
}

@@ -336,3 +333,3 @@

interface WatchConstructor<T extends IFileManager<U>, U extends ExternalAsset = ExternalAsset, V extends IWatch<T, U> = IWatch<T, U>> extends ModuleConstructor {
interface WatchConstructor<T extends IFileManager<U>, U extends ExternalAsset = ExternalAsset, V extends WatchModule = WatchModule, W extends FunctionType<unknown, any> = ModifiedPostFinalizeListener<U>> extends ModuleConstructor {
createServer(port: number, active: boolean): Undef<ws.Server>;

@@ -353,5 +350,5 @@ createServer(port: number, secure?: Null<SecureOptions>, active?: boolean): Undef<ws.Server>;

parseExpires(value: NumString, start?: number): number;
readonly prototype: V;
new(module?: WatchModule): V;
new(interval?: number, port?: number, securePort?: number, extensions?: unknown[]): V;
readonly prototype: IWatch<T, U, V, W>;
new(module?: V): IWatch<T, U, V, W>;
new(interval?: number, port?: number, securePort?: number, extensions?: unknown[]): IWatch<T, U, V, W>;
}

@@ -414,3 +411,3 @@

removeAsyncTask(): void;
completeAsyncTask(err?: unknown, uri?: string, parent?: T, type?: FILE_TYPE): void;
completeAsyncTask(err?: unknown, uri?: string, parent?: T, type?: number): void;
performFinalize(override?: boolean): void;

@@ -430,4 +427,4 @@ hasDocument(instance: IModule, document: Undef<StringOfArray>): boolean;

addDownload(value: number | BufferContent, encoding: BufferEncoding): number;
addDownload(value: number | BufferContent, type?: DOWNLOAD_TYPE, encoding?: BufferEncoding): number;
getDownload(type?: DOWNLOAD_TYPE): [number, number];
addDownload(value: number | BufferContent, type?: number, encoding?: BufferEncoding): number;
getDownload(type?: number): [number, number];
transformAsset(data: IFileThread<T>, parent?: T): Promise<void>;

@@ -493,3 +490,3 @@ addCopy(data: FileCommand<T>, saveAs?: string, replace?: boolean): Undef<string>;

/* Set */
add(value: string, parent?: T, type?: FILE_TYPE): this;
add(value: string, parent?: T, type?: number): this;
delete(value: string, emptyDir?: boolean): boolean;

@@ -609,4 +606,4 @@ has(value: unknown): value is string;

readonly errors: unknown[];
allSettled: AllSettledMethod;
supported: ModuleSupportedMethod;
allSettled<U>(values: readonly (U | PromiseLike<U>)[], rejected?: LogValue, options?: LogFailOptions | LogType): Promise<PromiseSettledResult<U>[]>;
supported(major: number, minor?: number, patch?: number, lts?: boolean): boolean;
supports(name: string, value?: boolean): boolean;

@@ -656,5 +653,5 @@ getTempDir(options: GetTempDirOptions): string;

removeDir<U extends NoParamCallback>(src: string, options: RemoveDirOptions, callback: U): void;
formatMessage: ModuleFormatMessageMethod;
formatMessage(type: LogType, title: string, value: LogValue, message?: unknown, options?: LogMessageOptions): void;
formatFail(type: LogType, title: string, value: LogValue, message?: unknown, options?: LogFailOptions): void;
writeFail: ModuleWriteFailMethod;
writeFail(value: LogValue, message?: unknown, options?: LogFailOptions | LogType): void;
writeTimeProcess(title: string, value: string, startTime: LogTime, options?: LogProcessOptions): void;

@@ -732,3 +729,3 @@ writeTimeElapsed(title: string, value: LogValue, startTime: LogTime, options?: LogMessageOptions): void;

interface ModuleConstructor {
interface ModuleConstructor<T extends IHost = IHost> {
PROCESS_TIMEOUT: number;

@@ -745,8 +742,8 @@ LOG_STYLE_FAIL: LogMessageOptions;

readonly MAX_TIMEOUT: number;
supported: ModuleSupportedMethod;
formatMessage: ModuleFormatMessageMethod;
writeFail: ModuleWriteFailMethod;
supported(major: number, minor?: number, patch?: number, lts?: boolean): boolean;
formatMessage(type: LogType, title: string, value: LogValue, message?: unknown, options?: LogMessageOptions): void;
writeFail(value: LogValue, message?: unknown, options?: LogFailOptions | LogType): void;
enabled(key: string, username?: string): boolean;
parseFunction<T = unknown>(value: unknown, options?: ParseFunctionOptions): Null<FunctionType<Promise<T> | T>>;
parseFunction<T = unknown>(value: unknown, absolute: boolean, sync?: boolean): Null<FunctionType<Promise<T> | T>>;
parseFunction<U = unknown>(value: unknown, options?: ParseFunctionOptions): Null<FunctionType<Promise<U> | U>>;
parseFunction<U = unknown>(value: unknown, absolute: boolean, sync?: boolean): Null<FunctionType<Promise<U> | U>>;
asString(value: unknown, cacheKey?: boolean | "throws"): string;

@@ -811,9 +808,9 @@ asHash(data: BinaryLike, options: AsHashOptions): string;

/** @deprecated types + compat-v4 + module/lib-v4 (v5) */
isObject<T = object>(value: unknown): value is T;
isObject<U = object>(value: unknown): value is U;
/** @deprecated types + compat-v4 + module/lib-v4 (v5) */
isPlainObject<T = PlainObject>(value: unknown): value is T;
isPlainObject<U = PlainObject>(value: unknown): value is U;
/** @deprecated types + compat-v4 + module/lib-v4 (v5)*/
escapePattern(value: unknown, lookBehind?: boolean): string;
/** @deprecated types + compat-v4 + module/lib-v4 (v5) */
asFunction<T = unknown, U = FunctionType<Promise<T> | T>>(value: unknown, sync?: boolean): Null<U>;
asFunction<U = unknown, V = FunctionType<Promise<U> | U>>(value: unknown, sync?: boolean): Null<V>;
/** @deprecated types + compat-v4 + module/lib-v4 (v5) */

@@ -828,11 +825,11 @@ renameExt(value: string, ext: string, when?: string): string;

/** @deprecated types + compat-v4 + module/lib-v4 (v5) */
cloneObject<T>(data: T, deep: boolean): T;
cloneObject<U>(data: U, deep: boolean): U;
/** @deprecated types + compat-v4 + module/lib-v4 (v5) */
cloneObject<T>(data: T, deepIgnore: WeakSet<object>): T;
cloneObject<U>(data: U, deepIgnore: WeakSet<object>): U;
/** @deprecated types + compat-v4 + module/lib-v4 (v5) */
cloneObject<T, U>(data: T, options?: CloneObjectOptions<U>): T;
cloneObject<U, V>(data: U, options?: CloneObjectOptions<V>): U;
/** @deprecated types + compat-v4 + module/lib-v4 (v5) */
coerceObject<T>(data: T, cache: boolean): T;
coerceObject<U>(data: U, cache: boolean): U;
/** @deprecated types + compat-v4 + module/lib-v4 (v5) */
coerceObject<T>(data: T, parseString?: FunctionType<unknown, string>, cache?: boolean): T;
coerceObject<U>(data: U, parseString?: FunctionType<unknown, string>, cache?: boolean): U;
/** @deprecated types:convertTime + compat-v4 + module/lib-v4 (v5) */

@@ -861,9 +858,9 @@ toTimeMs(hrtime: HighResolutionTime, format: true): string;

/** @deprecated compat-v4 + module/lib-v4 (v5) */
getFunctions<T extends FunctionType>(values: unknown[], options?: GetFunctionsOptions): T[];
getFunctions<U extends FunctionType>(values: unknown[], options?: GetFunctionsOptions): U[];
/** @deprecated compat-v4 + module/lib-v4 (v5) */
getFunctions<T extends FunctionType>(values: unknown[], absolute?: boolean, sync?: boolean, outFailed?: string[]): T[];
getFunctions<U extends FunctionType>(values: unknown[], absolute?: boolean, sync?: boolean, outFailed?: string[]): U[];
/** @deprecated compat-v4 + module/lib-v4 (v5) */
allSettled: AllSettledMethod;
readonly prototype: IModule;
new(): IModule;
allSettled<U>(values: readonly (U | PromiseLike<U>)[], rejected?: LogValue, options?: LogFailOptions | LogType): Promise<PromiseSettledResult<U>[]>;
readonly prototype: IModule<T>;
new(): IModule<T>;
}

@@ -870,0 +867,0 @@ }

@@ -124,4 +124,2 @@ import type { LogStatus } from './squared';

export type BroadcastOutMethod = (value: string, options: LogMessageOptions, require?: NodeRequire) => void;
export type BroadcastValue = StringOfArray | { value: StringOfArray; stripAnsi?: boolean };
export type ModuleWriteFailMethod = (value: LogValue, message?: unknown, options?: LogFailOptions | LogType) => void;
export type ModuleFormatMessageMethod = (type: LogType, title: string, value: LogValue, message?: unknown, options?: LogMessageOptions) => void;
export type BroadcastValue = StringOfArray | { value: StringOfArray; stripAnsi?: boolean };

@@ -203,3 +203,3 @@ import type { PermissionAction, PermissionSettings, PermittedDirectories } from './core';

export type ImageModule = ClientModule<ImageSettings>;
export type ImageModule<T = ImageSettings> = ClientModule<T>;

@@ -206,0 +206,0 @@ export interface ImageSettings extends PlainObject {

{
"name": "@squared-functions/types",
"version": "4.9.8",
"version": "4.9.9",
"description": "Type definitions for squared-functions.",

@@ -17,3 +17,3 @@ "types": "index.d.ts",

"author": "An Pham <anpham6@gmail.com>",
"license": "Apache 2.0",
"license": "MIT",
"homepage": "https://github.com/anpham6/squared-functions#readme",

@@ -20,0 +20,0 @@ "dependencies": {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc