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.8.37 to 4.8.38

33

index.d.ts

@@ -0,1 +1,4 @@

/// <reference path="./lib/type.d.ts" />
/// <reference path="./lib/object.d.ts" />
import type { LogArguments } from './lib/logger';

@@ -161,2 +164,24 @@ import type { CloneObjectOptions } from './lib/module';

interface DB_TRANSACTION {
ACTIVE: 1;
PARTIAL: 2;
COMMIT: 4;
TERMINATE: 8;
ABORT: 16;
FAIL: 32;
AUTH: 64;
CACHE: 128;
}
const DB_TRANSACTION: {
ACTIVE: 1;
PARTIAL: 2;
COMMIT: 4;
TERMINATE: 8;
ABORT: 16;
FAIL: 32;
AUTH: 64;
CACHE: 128;
};
interface WATCH_EVENT {

@@ -170,6 +195,6 @@ MODIFIED: "modified";

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

@@ -176,0 +201,0 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.errorMessage = exports.errorValue = exports.generateUUID = exports.decryptUTF8 = exports.encryptUTF8 = exports.cloneObject = exports.hasGlob = exports.escapePattern = exports.formatTime = exports.parseExpires = exports.parseTime = exports.isString = exports.isObject = exports.isPlainObject = exports.isArray = exports.setLogCurrent = exports.getLogCurrent = exports.existsFlag = exports.mainFlag = exports.processFlag = exports.modifiedFlag = exports.watchFlag = exports.usingFlag = exports.cloneFlag = exports.ignoreFlag = exports.hasBit = exports.createAbortError = exports.WATCH_EVENT = exports.DB_TYPE = exports.DOWNLOAD_TYPE = exports.ERR_CODE = exports.ASSET_FLAG = exports.FILE_TYPE = exports.STATUS_TYPE = exports.LOG_TYPE = void 0;
exports.errorMessage = exports.errorValue = exports.generateUUID = exports.decryptUTF8 = exports.encryptUTF8 = exports.cloneObject = exports.hasGlob = exports.escapePattern = exports.formatTime = exports.parseExpires = exports.parseTime = exports.isString = exports.isObject = exports.isPlainObject = exports.isArray = exports.setLogCurrent = exports.getLogCurrent = exports.existsFlag = exports.mainFlag = exports.processFlag = exports.modifiedFlag = exports.watchFlag = exports.usingFlag = exports.cloneFlag = exports.ignoreFlag = exports.hasBit = exports.createAbortError = exports.WATCH_EVENT = exports.DB_TYPE = exports.DB_TRANSACTION = exports.DOWNLOAD_TYPE = exports.ERR_CODE = exports.ASSET_FLAG = exports.FILE_TYPE = exports.STATUS_TYPE = exports.LOG_TYPE = void 0;
const crypto = require("crypto");

@@ -8,3 +8,3 @@ const uuid = require("uuid");

constructor() {
super('The operation was aborted');
super("The operation was aborted" /* ERR_MESSAGE.ABORTED_OPERATION */);
this.code = 'ABORT_ERR';

@@ -79,2 +79,13 @@ this.name = "AbortError" /* INTERNAL.ERR_ABORT */;

})(DOWNLOAD_TYPE = exports.DOWNLOAD_TYPE || (exports.DOWNLOAD_TYPE = {}));
var DB_TRANSACTION;
(function (DB_TRANSACTION) {
DB_TRANSACTION[DB_TRANSACTION["ACTIVE"] = 1] = "ACTIVE";
DB_TRANSACTION[DB_TRANSACTION["PARTIAL"] = 2] = "PARTIAL";
DB_TRANSACTION[DB_TRANSACTION["COMMIT"] = 4] = "COMMIT";
DB_TRANSACTION[DB_TRANSACTION["TERMINATE"] = 8] = "TERMINATE";
DB_TRANSACTION[DB_TRANSACTION["ABORT"] = 16] = "ABORT";
DB_TRANSACTION[DB_TRANSACTION["FAIL"] = 32] = "FAIL";
DB_TRANSACTION[DB_TRANSACTION["AUTH"] = 64] = "AUTH";
DB_TRANSACTION[DB_TRANSACTION["CACHE"] = 128] = "CACHE";
})(DB_TRANSACTION = exports.DB_TRANSACTION || (exports.DB_TRANSACTION = {}));
var DB_TYPE;

@@ -81,0 +92,0 @@ (function (DB_TYPE) {

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

import type { QueryResult, TimeoutAction } from './db';
import type { AddEventListenerOptions } from './dom';
import type { Settings } from './node';

@@ -9,0 +10,0 @@ import type { ClientDBSettings, ClientModule, DbCacheValue, DbCoerceSettings, DbSourceOptions } from './settings';

34

lib/db.d.ts

@@ -8,20 +8,30 @@ import type { DataSource, DbDataSource } from './squared';

import type { SecureContextOptions } from 'tls';
// @ts-ignore
import type { AggregateOptions, BulkWriteOptions, CollectionOptions, CommandOperationOptions, DbOptions, Document, Filter, MongoClientOptions, OptionalUnlessRequiredId, Sort, SortDirection, UpdateFilter } from 'mongodb';
// @ts-ignore
import type { CommandOptions } from '@redis/client/dist/lib/command-options';
// @ts-ignore
import type { ClientCommandOptions } from '@redis/client/dist/lib/client';
// @ts-ignore
import type { RedisClientOptions } from '@redis/client';
// @ts-ignore
import type { RedisCommandArgument } from '@redis/client/dist/lib/commands';
// @ts-ignore
import type { RedisJSON } from '@redis/json/dist/commands';
// @ts-ignore
import type { RediSearchSchema } from 'redis';
// @ts-ignore
import type { PoolOptions, QueryOptions } from 'mysql2/promise';
// @ts-ignore
import type { PoolConfig as PostgresPoolConfig, QueryArrayConfig } from 'pg';
// @ts-ignore
import type { BindParameters, ConnectionAttributes, ExecuteOptions, PoolAttributes } from 'oracledb';
// @ts-ignore
import type { ConnectionConfig as IConnectionConfig, ParameterOptions, TediousType, TediousTypes } from 'tedious';
// @ts-ignore
import type { PoolConfig as MSSQLPoolConfig } from 'tedious-connection-pool';
import type { SecureContextOptions } from 'tls';
interface ExecuteAction<T = unknown> {
export interface ExecuteAction<T = unknown> {
params?: T;

@@ -166,3 +176,3 @@ }

export interface ProcessRowsOptions {
disconnect?: VoidFunction;
disconnect?: () => void;
parallel?: boolean;

@@ -223,8 +233,8 @@ }

export interface DbPoolConstructor<T extends DbDataSource = DbDataSource, U = unknown> {
findKey<V extends IDbPool, W extends DbDataSource>(pools: ObjectMap<V>, uuidKey: unknown, poolKey: Undef<string>, ...items: W[]): Null<V>;
validateKey<V extends IDbPool>(pools: ObjectMap<V>, username: string, uuidKey: unknown): [string, Null<V>];
checkTimeout<V extends IDbPool>(pools: ObjectMap<V>, value: number, limit?: number): Promise<number>;
readonly prototype: IDbPool<T, U>;
new(pool: U, poolKey: string, uuidKey?: string): IDbPool<T, U>;
export interface DbPoolConstructor<T extends DbDataSource = DbDataSource, U = unknown, V = unknown> {
findKey<W extends IDbPool, X extends DbDataSource>(pools: ObjectMap<W>, uuidKey: unknown, poolKey: Undef<string>, ...items: X[]): Null<W>;
validateKey<W extends IDbPool>(pools: ObjectMap<W>, username: string, uuidKey: unknown): [string, Null<W>];
checkTimeout<W extends IDbPool>(pools: ObjectMap<W>, value: number, limit?: number): Promise<number>;
readonly prototype: IDbPool<T, U, V>;
new(pool: U, poolKey: string, uuidKey?: Null<AuthValue>): IDbPool<T, U, V>;
}

@@ -231,0 +241,0 @@

@@ -84,2 +84,3 @@ import type { LocationUri, MimeTypeAction } from './squared';

getSourceFiles(imports?: StringMap): Undef<SourceInput>;
toBaseConfig(all?: boolean): T;
set code(value);

@@ -117,2 +118,3 @@ get code(): string;

sourceMappingURL?: string;
inlineMap?: boolean;
emptySources?: boolean;

@@ -131,3 +133,3 @@ }

findSourceMap(code?: string, uri?: string): Undef<RawSourceMap>;
removeSourceMappingURL(value: string): [string, string?];
removeSourceMappingURL(value: string): [string, string?, Null<RawSourceMap>?];
isRaw(map: unknown): map is RawSourceMap;

@@ -134,0 +136,0 @@ readonly prototype: SourceMap;

@@ -1,17 +0,9 @@

/// <reference path="type.d.ts" />
/// <reference path="object.d.ts" />
interface BoxRect<T = number> {
top: T;
right: T;
bottom: T;
left: T;
interface EventListenerOptions {
capture?: boolean;
}
interface BoxRectDimension extends BoxRect, Dimension {
numberOfLines?: number;
overflow?: boolean;
}
type CssStyleMap = Partial<MapOfType<CSSStyleDeclaration, CssStyleAttr, string>>;
type CssStyleAttr = KeyOfType<CSSStyleDeclaration, string, string>;
export interface AddEventListenerOptions extends EventListenerOptions {
once?: boolean;
passive?: boolean;
signal?: AbortSignal;
}

@@ -15,3 +15,4 @@ import type { BundleAction, FileInfo, HttpProtocolVersion, LogStatus } from './squared';

QUEUED = 4,
RESTARTED = 5
RESTARTED = 5,
ABORTED = 6
}

@@ -18,0 +19,0 @@

@@ -1,3 +0,1 @@

/// <reference path="object.d.ts" />
import type { MimeTypeAction } from './squared';

@@ -4,0 +2,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 { LOG_TYPE, STATUS_TYPE, ExecCommand, LogArguments, LogComponent, LogDate, LogFailOptions, LogMessageOptions, LogOptions, LogProcessOptions, LogTime, LogType, LogValue, ModuleFormatMessageMethod, ModuleWriteFailMethod, StatusType } from './logger';
import type { LOG_TYPE, STATUS_TYPE, ExecCommand, LogArguments, LogComponent, LogDate, LogFailOptions, LogMessageOptions, LogOptions, LogProcessOptions, LogTime, LogType, LogValue, StatusType } from './logger';
import type { AsHashOptions, CheckSemVerOptions, CloneObjectOptions, CopyDirResult, CopyFileOptions, CreateDirOptions, DeleteFileOptions, GetFunctionsOptions, MoveFileOptions, ParseFunctionOptions, PermissionOptions, 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';

@@ -36,11 +34,13 @@ import type { SpawnOptions } from 'child_process';

import type { BinaryLike } from 'crypto';
import type * as EventEmitter from 'events';
// @ts-ignore
import type { BytesOptions } from 'bytes';
// @ts-ignore
import type { FileTypeResult } from 'file-type';
// @ts-ignore
import type * as ws from 'ws';
import type * as EventEmitter from 'events';
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?: LogType | LogFailOptions) => Promise<PromiseSettledResult<T>[]>;
type CpuUsage = NodeJS.CpuUsage;

@@ -84,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>;
}

@@ -101,3 +101,3 @@

readonly REGEXP_SIZERANGE: RegExp;
transform(localFile: string, command: string, options?: TransformOptions): Promise<Null<Buffer> | string>;
transform(file: string, command: string, options?: TransformOptions): Promise<Null<Buffer> | string>;
clamp(value: Undef<string>, min?: number, max?: number): number;

@@ -114,2 +114,3 @@ isBinary(value: unknown): value is string;

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

@@ -130,6 +131,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>;
readonly prototype: U;
new(module?: ImageModule): U;
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: IImageV3<T, U>;
new(module?: U): IImageV3<T, U>;
}

@@ -147,7 +149,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>;
}

@@ -186,7 +188,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>;
}

@@ -232,3 +234,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;

@@ -241,11 +243,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>;

@@ -285,3 +287,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[]);

@@ -292,4 +294,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, uri?: string): SourceMap;

@@ -299,7 +301,7 @@ writeSourceMap(uri: string, data: SourceCode, options?: SourceMapOptions): Undef<string>;

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>;
}

@@ -328,3 +330,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 {
parseExpires(value: NumString, start?: number): number;

@@ -340,5 +342,5 @@ readCACert(value: string, cache?: boolean): string;

checkTimeout(client: ws): boolean;
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>;
}

@@ -393,3 +395,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;

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

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

@@ -454,3 +456,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;

@@ -560,3 +562,4 @@ has(value: unknown): value is string;

readonly errors: unknown[];
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;

@@ -606,10 +609,9 @@ getTempDir(uuidDir: boolean, createDir?: boolean): string;

removeDir<U extends NoParamCallback>(src: string, options: RemoveDirOptions, callback: U): void;
allSettled: AllSettledMethod;
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;
writeTimeElapsed(title: string, value: LogValue, startTime: LogTime, options?: LogMessageOptions): void;
checkPackage(err: unknown, name: Undef<string>, options?: LogFailOptions): boolean;
checkPackage(err: unknown, name: Undef<string>, value?: LogValue, options?: LogFailOptions): boolean;
checkPackage(err: unknown, name: Undef<string>, options?: LogFailOptions | LogType): boolean;
checkPackage(err: unknown, name: Undef<string>, value?: LogValue, options?: LogFailOptions | LogType): boolean;
checkFail(message: unknown, options: LogFailOptions): Undef<LogArguments | false>;

@@ -689,5 +691,5 @@ writeLog(component: LogComponent, queue?: boolean): void;

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;

@@ -759,2 +761,3 @@ isString(value: unknown): value is string;

formatCpuMem(start: CpuUsage, all?: boolean): string;
getPackageVersion(name: string | [string, string], startDir: string): string;
getPackageVersion(name: string | [string, string], unstable?: boolean, startDir?: string): string;

@@ -770,3 +773,3 @@ checkSemVer(name: string | [string, string], options: CheckSemVerOptions): boolean;

loadSettings(settings: Settings, password?: string): boolean;
allSettled: AllSettledMethod;
allSettled<U>(values: readonly (U | PromiseLike<U>)[], rejected?: LogValue, options?: LogFailOptions | LogType): Promise<PromiseSettledResult<U>[]>;
readonly prototype: IModule;

@@ -773,0 +776,0 @@ new(): IModule;

@@ -1,9 +0,8 @@

/// <reference path="type.d.ts" />
import type { LogStatus } from './squared';
import type { BackgroundColor, ForegroundColor } from 'chalk';
import type { LOG_TYPE, STATUS_TYPE } from '../index.d';
// @ts-ignore
import type { BackgroundColor as IBackgroundColor, ForegroundColor as IForegroundColor } from 'chalk';
type HexColor = `#${string}`;

@@ -23,13 +22,13 @@

export interface LoggerColor {
titleColor?: typeof ForegroundColor | HexColor;
titleBgColor?: typeof BackgroundColor | HexColor;
titleColor?: ForegroundColor;
titleBgColor?: BackgroundColor;
titleBold?: boolean;
valueColor?: typeof ForegroundColor | HexColor;
valueBgColor?: typeof BackgroundColor | HexColor;
valueColor?: ForegroundColor;
valueBgColor?: BackgroundColor;
valueBold?: boolean;
hintColor?: typeof ForegroundColor | HexColor;
hintBgColor?: typeof BackgroundColor | HexColor;
hintColor?: ForegroundColor;
hintBgColor?: BackgroundColor;
hintBold?: boolean;
messageColor?: typeof ForegroundColor | HexColor;
messageBgColor?: typeof BackgroundColor | HexColor;
messageColor?: ForegroundColor;
messageBgColor?: BackgroundColor;
messageBold?: boolean;

@@ -40,4 +39,4 @@ }

width?: T;
color?: typeof ForegroundColor | HexColor;
bgColor?: typeof BackgroundColor | HexColor;
color?: ForegroundColor;
bg_color?: BackgroundColor;
bold?: boolean;

@@ -115,7 +114,7 @@ justify?: TextAlign;

export type LogComponent = Partial<Pick<LogStatus<StatusType>, "type" | "value" | "timeStamp" | "duration" | "from">>;
export type BackgroundColor = typeof IBackgroundColor | HexColor;
export type ForegroundColor = typeof IForegroundColor | HexColor;
export type TextAlign = "left" | "center" | "right";
export type ErrorOutMethod = (err: Error, data: LogTypeValue, require?: NodeRequire) => void;
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?: LogType | LogFailOptions) => void;
export type ModuleFormatMessageMethod = (type: LogType, title: string, value: LogValue, message?: unknown, options?: LogMessageOptions) => void;
export type BroadcastValue = StringOfArray | { value: StringOfArray; stripAnsi?: boolean };

@@ -10,4 +10,8 @@ import type { PermissionAction, PermissionSettings, PermittedDirectories } from './core';

import type { BinaryLike, CipherGCMTypes } from 'crypto';
// @ts-ignore
import type { PicomatchOptions } from 'picomatch';
// @ts-ignore
import type { IOptions } from 'minimatch';
// @ts-ignore
import type { Unit } from 'bytes';

@@ -183,3 +187,3 @@

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

@@ -298,11 +302,13 @@ export interface ImageSettings extends PlainObject {

export interface LoggerModule<T = NumString, U = boolean | T> {
export interface LoggerModule<T = NumString, U = boolean | T, V = LoggerFormat<T>> {
enabled?: boolean;
level?: NumString;
production?: string[];
format?: {
title?: LoggerFormat<T>;
value?: LoggerFormat<T>;
hint?: LoggerFormat<T> & { unit?: "auto" | "s" | "ms" };
session_id?: LoggerFormat<T>;
message?: LoggerFormat<T>;
meter?: LoggerFormat<T>;
title?: V;
value?: V;
hint?: V & { unit?: "auto" | "s" | "ms" };
session_id?: V;
message?: V;
meter?: V;
};

@@ -309,0 +315,0 @@ meter?: {

/// <reference path="type.d.ts" />
/// <reference path="dom.d.ts" />
/// <reference path="object.d.ts" />

@@ -24,2 +24,14 @@ interface Asset extends MimeTypeAction {

interface BoxRect<T = number> {
top: T;
right: T;
bottom: T;
left: T;
}
interface BoxRectDimension extends BoxRect, Dimension {
numberOfLines?: number;
overflow?: boolean;
}
export interface FileAsset extends TextAsset, OutputAction, DocumentAction, MultipartAction, ResourceAction {

@@ -300,3 +312,3 @@ format?: StringOfArray;

bounds: BoxRectDimension;
css: CssStyleMap;
css: PlainObject;
outerWrapperIds?: string[];

@@ -303,0 +315,0 @@ }

@@ -12,2 +12,3 @@ import type { DataSource, WatchResponse } from './squared';

// @ts-ignore
import type * as ws from 'ws';

@@ -14,0 +15,0 @@

{
"name": "@squared-functions/types",
"version": "4.8.37",
"version": "4.8.38",
"description": "Type definitions for squared-functions",

@@ -5,0 +5,0 @@ "types": "index.d.ts",

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