@squared-functions/types
Advanced tools
Comparing version 0.3.11 to 0.4.0
@@ -6,3 +6,2 @@ /// <reference path="type.d.ts" /> | ||
import type { WriteStream } from 'fs'; | ||
import type * as jimp from 'jimp'; | ||
@@ -12,2 +11,4 @@ declare namespace functions { | ||
type ExternalCategory = "html" | "css" | "js"; | ||
type ImageOutputFormat = "png" | "jpeg" | "bmp"; | ||
type FileManagerWriteImageCallback = (file: ExpressAsset, filepath: string, output: string, command: string, compress?: squared.base.CompressFormat, err?: Null<Error>) => void; | ||
@@ -30,7 +31,2 @@ namespace squared { | ||
interface Exclusions extends Partial<LocationUri> { | ||
extension?: string[]; | ||
pattern?: string[]; | ||
} | ||
interface CompressFormat { | ||
@@ -59,2 +55,3 @@ format: string; | ||
tasks?: string[]; | ||
attributes?: AttributeValue[]; | ||
preserve?: boolean; | ||
@@ -67,4 +64,10 @@ inlineContent?: string; | ||
textContent?: string; | ||
dataMap?: DataMap; | ||
} | ||
interface AttributeValue { | ||
name: string; | ||
value?: Null<string>; | ||
} | ||
interface FormattableContent { | ||
@@ -132,3 +135,3 @@ value: string; | ||
findFormat(compress: Undef<squared.base.CompressFormat[]>, format: string): Undef<squared.base.CompressFormat>; | ||
findCompress(compress: Undef<squared.base.CompressFormat[]>): Undef<squared.base.CompressFormat>; | ||
hasImageService(): boolean; | ||
removeFormat(compress: Undef<squared.base.CompressFormat[]>, format: string): void; | ||
@@ -140,12 +143,8 @@ parseSizeRange(value: string): [number, number]; | ||
interface IImage extends IModule { | ||
jpegQuality: number; | ||
isJpeg(filename: string, mimeType?: string, filepath?: string): boolean; | ||
using(file: ExpressAsset, filepath: string, compress?: squared.base.CompressFormat, command?: string): void; | ||
parseResize(value: string): Undef<internal.ResizeData>; | ||
parseCrop(value: string): Undef<internal.CropData>; | ||
parseOpacity(value: string): number; | ||
parseQuality(value: string): number; | ||
parseRotation(value: string): Undef<internal.RotateData>; | ||
resize(instance: jimp, options: internal.ResizeData): jimp; | ||
crop(instance: jimp, options: internal.CropData): jimp; | ||
opacity(instance: jimp, value: number): jimp; | ||
rotate(instance: jimp, options: internal.RotateData, filepath: string, preRotate?: () => void, postWrite?: (result?: unknown) => void): jimp; | ||
} | ||
@@ -179,3 +178,2 @@ | ||
Gulp?: StringMap; | ||
Chrome?: IChrome; | ||
readonly files: Set<string>; | ||
@@ -189,6 +187,8 @@ readonly filesQueued: Set<string>; | ||
readonly postFinalize: FunctionType<void>; | ||
readonly requestMain?: ExpressAsset; | ||
readonly dataMap: chrome.DataMap; | ||
readonly baseAsset?: ExpressAsset; | ||
install(name: string, ...args: any[]): void; | ||
add(value: string): void; | ||
delete(value: string): void; | ||
replace(file: ExpressAsset, replaceWith: string): void; | ||
performAsyncTask(): void; | ||
@@ -202,4 +202,2 @@ removeAsyncTask(): void; | ||
escapePathSeparator(value: string): string; | ||
replace(file: ExpressAsset, replaceWith: string): void; | ||
validate(file: ExpressAsset, exclusions: squared.base.Exclusions): boolean; | ||
getFileOutput(file: ExpressAsset): internal.FileOutput; | ||
@@ -209,8 +207,12 @@ getRelativeUrl(file: ExpressAsset, url: string): Undef<string>; | ||
getUTF8String(file: ExpressAsset, filepath?: string): string; | ||
transformCss(file: ExpressAsset, content: string): Undef<string>; | ||
appendContent(file: ExpressAsset, filepath: string, content: string, bundleIndex: number): Promise<string>; | ||
getTrailingContent(file: ExpressAsset): Promise<string>; | ||
newImage(filepath: string, mimeType: string, ouputType: string, saveAs: string, command?: string): string; | ||
compressImage(filepath: string, output: string): void; | ||
replaceImage(file: ExpressAsset, filepath: string, output: string, command: string): void; | ||
writeImage: FileManagerWriteImageCallback; | ||
transformCss(file: ExpressAsset, content: string): Undef<string>; | ||
transformBuffer(file: ExpressAsset, filepath: string): Promise<void>; | ||
compressFile(file: ExpressAsset, filepath: string, cached?: boolean): void; | ||
writeBuffer(file: ExpressAsset, filepath: string, cached?: boolean): void; | ||
writeBuffer(file: ExpressAsset, filepath: string): void; | ||
finalizeFile(file: ExpressAsset, filepath: string): void; | ||
processAssets(): void; | ||
@@ -247,2 +249,21 @@ finalizeAssets(): Promise<unknown[]>; | ||
class ImageProxy<T> { | ||
instance: T; | ||
filepath: string | ||
command: string | ||
resizeData?: internal.ResizeData; | ||
cropData?: internal.CropData; | ||
rotateData?: internal.RotateData; | ||
qualityValue: number; | ||
opacityValue: number; | ||
errorHandler?: (err: Error) => void; | ||
resize(): void; | ||
crop(): void; | ||
opacity(): void; | ||
quality(): void; | ||
rotate(preRotate?: () => void, postWrite?: (result?: unknown) => void): void; | ||
write(output: string, file?: ExpressAsset, compress?: squared.base.CompressFormat, callback?: FileManagerWriteImageCallback): void; | ||
constructor(instance: T, filepath: string, command?: string); | ||
} | ||
interface Settings { | ||
@@ -258,3 +279,2 @@ version?: string; | ||
brotli_quality?: NumString; | ||
jpeg_quality?: NumString; | ||
tinypng_api_key?: string; | ||
@@ -305,4 +325,2 @@ env?: string; | ||
interface ExpressAsset extends squared.base.FileAsset, chrome.ChromeAsset { | ||
dataMap?: chrome.DataMap; | ||
exclusions?: squared.base.Exclusions; | ||
filepath?: string; | ||
@@ -309,0 +327,0 @@ invalid?: boolean; |
{ | ||
"name": "@squared-functions/types", | ||
"version": "0.3.11", | ||
"version": "0.4.0", | ||
"description": "Type definitions for squared-functions", | ||
@@ -5,0 +5,0 @@ "types": "lib/index.d.ts", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14003
300