@squared-functions/types
Advanced tools
Comparing version 0.5.5 to 0.6.0
@@ -40,12 +40,31 @@ /// <reference path="type.d.ts" /> | ||
interface FilePostResult { | ||
interface CloudService { | ||
service: string; | ||
active?: boolean; | ||
localStorage?: boolean; | ||
uploadAll?: boolean; | ||
filename?: string; | ||
apiEndpoint?: string; | ||
settings?: string; | ||
objects?: CloudObject[]; | ||
[key: string]: Undef<unknown>; | ||
} | ||
interface CloudObject extends Partial<LocationUri> { | ||
keyName: string; | ||
} | ||
interface ResponseData { | ||
success: boolean; | ||
data?: unknown; | ||
zipname?: string; | ||
bytes?: number; | ||
files?: string[]; | ||
error?: { | ||
message: string; | ||
hint?: string; | ||
}; | ||
error?: ResponseError; | ||
} | ||
interface ResponseError { | ||
message: string; | ||
hint?: string; | ||
} | ||
} | ||
@@ -58,24 +77,20 @@ | ||
format?: string; | ||
preserve?: boolean; | ||
watch?: boolean | WatchInterval; | ||
tasks?: string[]; | ||
attributes?: AttributeValue[]; | ||
cloudStorage?: CloudService[]; | ||
preserve?: boolean; | ||
inlineContent?: string; | ||
cloudStorage?: squared.CloudService[]; | ||
exclude?: boolean; | ||
basePath?: string; | ||
bundleId?: number; | ||
bundleIndex?: number; | ||
bundleRoot?: string; | ||
trailingContent?: FormattableContent[]; | ||
textContent?: string; | ||
dataMap?: DataMap; | ||
inlineContent?: string; | ||
} | ||
interface CloudService { | ||
service: string; | ||
active?: boolean; | ||
localStorage?: boolean; | ||
uploadAll?: boolean; | ||
filename?: string; | ||
apiEndpoint?: string; | ||
settings?: string; | ||
[key: string]: Undef<unknown>; | ||
interface WatchInterval { | ||
interval?: number; | ||
expires?: string; | ||
} | ||
@@ -94,7 +109,2 @@ | ||
interface DataMap { | ||
unusedStyles?: string[]; | ||
transpileMap?: TranspileMap; | ||
} | ||
interface TranspileMap { | ||
@@ -108,3 +118,3 @@ html: ObjectMap<StringMap>; | ||
namespace internal { | ||
namespace serve { | ||
namespace Serve { | ||
interface Routing { | ||
@@ -120,3 +130,3 @@ [key: string]: Route[]; | ||
namespace image { | ||
namespace Image { | ||
interface UsingOptions { | ||
@@ -150,2 +160,34 @@ data: FileData; | ||
namespace Chrome { | ||
interface SourceMapInput { | ||
file: ExternalAsset; | ||
fileUri: string; | ||
sourcesContent: Null<string>; | ||
sourceMap: Map<string, SourceMapOutput>; | ||
map?: SourceMap; | ||
packageName?: string; | ||
nextMap: (packageName: string, map: SourceMap | string, value: string, includeSources?: boolean) => boolean; | ||
} | ||
interface SourceMapOutput { | ||
value: string; | ||
map: SourceMap; | ||
sourcesContent: Null<string>; | ||
url?: string; | ||
} | ||
interface SourceMap { | ||
version: number; | ||
file?: string; | ||
sourceRoot?: string; | ||
sources: string[]; | ||
sourcesContent?: Null<string>[]; | ||
names: string[]; | ||
mappings: string; | ||
} | ||
type ConfigOrTranspiler = StandardMap | FunctionType<string>; | ||
type PluginConfig = [string, Undef<ConfigOrTranspiler>, Undef<StandardMap>] | []; | ||
} | ||
interface FileData { | ||
@@ -160,6 +202,2 @@ file: ExternalAsset; | ||
} | ||
type Config = StandardMap | string; | ||
type ConfigOrTranspiler = Config | FunctionType<string>; | ||
type PluginConfig = [string, Undef<ConfigOrTranspiler>, Config]; | ||
} | ||
@@ -169,3 +207,3 @@ | ||
interface CloudUploadOptions { | ||
config: chrome.CloudService; | ||
config: squared.CloudService; | ||
filename: string; | ||
@@ -181,4 +219,4 @@ fileUri: string; | ||
type CloudServiceClient = (data: chrome.CloudService, settings: StandardMap) => boolean; | ||
type CloudServiceHost = (this: IFileManager, config: chrome.CloudService) => CloudServiceUpload; | ||
type CloudServiceClient = (data: squared.CloudService, settings: StandardMap) => boolean; | ||
type CloudServiceHost = (this: IFileManager, config: squared.CloudService) => CloudServiceUpload; | ||
type CloudServiceUpload = (buffer: Buffer, success: (value?: unknown) => void, options: CloudUploadOptions) => void; | ||
@@ -218,10 +256,10 @@ } | ||
interface INode extends IModule { | ||
enableDiskRead(): void; | ||
enableDiskWrite(): void; | ||
enableUNCRead(): void; | ||
enableUNCWrite(): void; | ||
canReadDisk(): boolean; | ||
canWriteDisk(): boolean; | ||
canReadUNC(): boolean; | ||
canWriteUNC(): boolean; | ||
setDiskRead(): void; | ||
setDiskWrite(): void; | ||
setUNCRead(): void; | ||
setUNCWrite(): void; | ||
hasDiskRead(): boolean; | ||
hasDiskWrite(): boolean; | ||
hasUNCRead(): boolean; | ||
hasUNCWrite(): boolean; | ||
isFileURI(value: string): boolean; | ||
@@ -233,3 +271,3 @@ isFileUNC(value: string): boolean; | ||
resolvePath(value: string, href: string, hostname?: boolean): Undef<string>; | ||
toPosixPath(value: string): string; | ||
toPosix(value: string): string; | ||
} | ||
@@ -252,28 +290,36 @@ | ||
interface IImage extends IModule { | ||
using(options: internal.image.UsingOptions): void; | ||
parseCrop(value: string): Undef<internal.image.CropData>; | ||
using(options: internal.Image.UsingOptions): void; | ||
parseCrop(value: string): Undef<internal.Image.CropData>; | ||
parseOpacity(value: string): number; | ||
parseQuality(value: string): Undef<internal.image.QualityData>; | ||
parseResize(value: string): Undef<internal.image.ResizeData>; | ||
parseRotation(value: string): Undef<internal.image.RotateData>; | ||
parseQuality(value: string): Undef<internal.Image.QualityData>; | ||
parseResize(value: string): Undef<internal.Image.ResizeData>; | ||
parseRotation(value: string): Undef<internal.Image.RotateData>; | ||
parseMethod(value: string): Undef<string[]>; | ||
} | ||
interface ICloud extends IModule { | ||
settings: settings.CloudModule; | ||
getService(data: Undef<squared.CloudService[]>): Undef<squared.CloudService>; | ||
hasService(data: squared.CloudService): data is squared.CloudService; | ||
} | ||
interface IChrome extends IModule { | ||
settings: settings.ChromeModule; | ||
findPlugin(settings: Undef<ObjectMap<StandardMap>>, name: string): internal.PluginConfig; | ||
findTranspiler(settings: Undef<ObjectMap<StandardMap>>, name: string, category: ExternalCategory, transpileMap?: chrome.TranspileMap): internal.PluginConfig; | ||
createTranspiler(value: string): Null<FunctionType<string>>; | ||
createConfig(value: string): Undef<StandardMap | string>; | ||
transform(type: ExternalCategory, format: string, value: string, transpileMap?: chrome.TranspileMap): Promise<Void<string>>; | ||
formatContent(mimeType: string, format: string, value: string, transpileMap?: chrome.TranspileMap): Promise<Void<string>>; | ||
removeCss(source: string, styles: string[]): Undef<string>; | ||
unusedStyles?: string[]; | ||
transpileMap?: chrome.TranspileMap; | ||
findPlugin(settings: Undef<ObjectMap<StandardMap>>, name: string): internal.Chrome.PluginConfig; | ||
findTranspiler(settings: Undef<ObjectMap<StandardMap>>, name: string, category: ExternalCategory): internal.Chrome.PluginConfig; | ||
loadOptions(value: internal.Chrome.ConfigOrTranspiler | string): Undef<internal.Chrome.ConfigOrTranspiler>; | ||
loadConfig(value: string): Undef<StandardMap | string>; | ||
loadTranspiler(value: string): Null<FunctionType<string>>; | ||
createSourceMap(file: ExternalAsset, fileUri: string, sourcesContent: string): internal.Chrome.SourceMapInput; | ||
transform(type: ExternalCategory, format: string, value: string, input: internal.Chrome.SourceMapInput): Promise<Void<[string, Map<string, internal.Chrome.SourceMapOutput>]>>; | ||
} | ||
interface ICloud extends IModule { | ||
settings: settings.CloudModule; | ||
getService(data: Undef<chrome.CloudService[]>): Undef<chrome.CloudService>; | ||
hasService(data: chrome.CloudService): data is chrome.CloudService; | ||
interface ChromeConstructor { | ||
new(): IChrome; | ||
} | ||
const Chrome: ChromeConstructor; | ||
interface IFileManager extends IModule { | ||
@@ -287,3 +333,4 @@ serverRoot: string; | ||
Chrome?: IChrome; | ||
Cloud?: ICloud; | ||
Cloud?: settings.CloudModule; | ||
Compress?: settings.CompressModule; | ||
Gulp?: settings.GulpModule; | ||
@@ -298,3 +345,2 @@ readonly files: Set<string>; | ||
readonly postFinalize: FunctionType<void>; | ||
readonly dataMap: chrome.DataMap; | ||
readonly baseAsset?: ExternalAsset; | ||
@@ -321,3 +367,6 @@ install(name: string, ...args: unknown[]): void; | ||
getTrailingContent(file: ExternalAsset): Promise<string>; | ||
getBundleContent(fileUri: string): Undef<string>; | ||
writeSourceMap(file: ExternalAsset, fileUri: string, sourceData: [string, Map<string, internal.Chrome.SourceMapOutput>], sourceContent: string, modified: boolean): void; | ||
transformCss(file: ExternalAsset, content: string): Undef<string>; | ||
removeCss(source: string, styles: string[]): Undef<string>; | ||
newImage(data: internal.FileData, ouputType: string, saveAs: string, command?: string): string; | ||
@@ -327,5 +376,5 @@ transformBuffer(data: internal.FileData): Promise<void>; | ||
finalizeImage: FileManagerWriteImageCallback; | ||
finalizeFile(data: internal.FileData, parent?: ExternalAsset): Promise<void>; | ||
processAssets(): void; | ||
finalizeAssets(): Promise<unknown[]>; | ||
finalizeAsset(data: internal.FileData, parent?: ExternalAsset): Promise<void>; | ||
processAssets(watch?: boolean): void; | ||
finalize(): Promise<unknown[]>; | ||
} | ||
@@ -339,5 +388,4 @@ | ||
moduleImage(): IImage; | ||
moduleChrome(): IChrome; | ||
moduleCloud(): ICloud; | ||
new(dirname: string, body: RequestBody, postFinalize: FunctionType<void>, productionRelease?: boolean): IFileManager; | ||
new(dirname: string, body: RequestBody, postFinalize?: FunctionType<void>): IFileManager; | ||
} | ||
@@ -355,4 +403,4 @@ | ||
getTempDir(): string; | ||
writeMessage(value: string, message: unknown, title?: string, color?: "green" | "yellow" | "blue" | "white" | "grey"): void; | ||
writeFail(value: string, message: unknown): void; | ||
writeMessage(value: string, message?: unknown, title?: string, color?: "green" | "yellow" | "blue" | "white" | "grey"): void; | ||
writeFail(value: string, message?: unknown): void; | ||
} | ||
@@ -370,6 +418,6 @@ | ||
command: string | ||
resizeData?: internal.image.ResizeData; | ||
cropData?: internal.image.CropData; | ||
rotateData?: internal.image.RotateData; | ||
qualityData?: internal.image.QualityData; | ||
resizeData?: internal.Image.ResizeData; | ||
cropData?: internal.Image.CropData; | ||
rotateData?: internal.Image.RotateData; | ||
qualityData?: internal.Image.QualityData; | ||
opacityValue: number; | ||
@@ -383,3 +431,3 @@ errorHandler?: (err: Error) => void; | ||
rotate(parent?: ExternalAsset, preRotate?: FileManagerPerformAsyncTaskCallback, postWrite?: FileManagerCompleteAsyncTaskCallback): void; | ||
write(output: string, options?: internal.image.UsingOptions): void; | ||
write(output: string, options?: internal.Image.UsingOptions): void; | ||
finalize(output: string, callback: (result: string) => void): void; | ||
@@ -410,5 +458,6 @@ constructor(instance: T, fileUri: string, command?: string, finalAs?: string); | ||
request_post_limit?: string; | ||
watch_interval?: number; | ||
env?: string; | ||
port?: StringMap; | ||
routing?: internal.serve.Routing; | ||
routing?: internal.Serve.Routing; | ||
compress?: settings.CompressModule; | ||
@@ -420,5 +469,6 @@ cloud?: settings.CloudModule; | ||
interface RequestBody { | ||
interface RequestBody extends PlainObject { | ||
assets: ExternalAsset[]; | ||
dataMap?: chrome.DataMap; | ||
unusedStyles?: string[]; | ||
transpileMap?: chrome.TranspileMap; | ||
} | ||
@@ -428,10 +478,12 @@ | ||
fileUri?: string; | ||
transforms?: string[]; | ||
invalid?: boolean; | ||
cloudUri?: string; | ||
buffer?: Buffer; | ||
sourceUTF8?: string; | ||
originalName?: string; | ||
transforms?: string[]; | ||
inlineBase64?: string; | ||
inlineCloud?: string; | ||
inlineCssCloud?: string; | ||
originalName?: string; | ||
etag?: string; | ||
invalid?: boolean; | ||
} | ||
@@ -438,0 +490,0 @@ } |
{ | ||
"name": "@squared-functions/types", | ||
"version": "0.5.5", | ||
"version": "0.6.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
19469
432