@b10cks/client 1.6.0 → 1.7.0
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/dist/index.d.ts +111 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -124,6 +124,111 @@ export declare interface B10cksApiClientRvOptions {
|
|
|
124
124
|
setRv?: (value: string | number) => void;
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
+
/**
|
|
128
|
+
* WCAG contrast stats derived from an asset's dominant color, so consumers
|
|
129
|
+
* can pick accessible overlay/text colors for content rendered on top of
|
|
130
|
+
* the image without recomputing contrast client-side.
|
|
131
|
+
*/
|
|
132
|
+
export declare interface B10cksAssetA11y {
|
|
133
|
+
/** `'dark'` = treat the image as a dark surface (use light overlays/text). */
|
|
134
|
+
scheme: 'dark' | 'light';
|
|
135
|
+
/** WCAG relative luminance of the dominant color (0–1). */
|
|
136
|
+
luminance: number;
|
|
137
|
+
/** Contrast ratio of white text against the dominant color (1–21). */
|
|
138
|
+
contrast_white: number;
|
|
139
|
+
/** Contrast ratio of black text against the dominant color (1–21). */
|
|
140
|
+
contrast_black: number;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/** EXIF subset extracted from JPEG/TIFF uploads. */
|
|
144
|
+
export declare interface B10cksAssetExif {
|
|
145
|
+
make?: string | null;
|
|
146
|
+
model?: string | null;
|
|
147
|
+
exposure?: string | number | null;
|
|
148
|
+
aperture?: string | number | null;
|
|
149
|
+
iso?: string | number | null;
|
|
150
|
+
dateTaken?: string | null;
|
|
151
|
+
orientation?: number | null;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/** ID3-style tags extracted from audio uploads. */
|
|
155
|
+
export declare interface B10cksAssetMediaTags {
|
|
156
|
+
title?: string | null;
|
|
157
|
+
artist?: string | null;
|
|
158
|
+
album?: string | null;
|
|
159
|
+
year?: string | null;
|
|
160
|
+
genre?: string | null;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Metadata extracted from an asset at upload time. Which fields are present
|
|
165
|
+
* depends on the file type (image, video, audio, document); content delivery
|
|
166
|
+
* additionally whitelists to `width`, `height`, `duration`, `thumbnails`,
|
|
167
|
+
* `dominant_color` and `a11y`. Custom metadata supplied at upload is carried
|
|
168
|
+
* through via the index signature.
|
|
169
|
+
*/
|
|
170
|
+
export declare interface B10cksAssetMetadata {
|
|
171
|
+
type?: 'image' | 'video' | 'audio' | 'document' | 'file';
|
|
172
|
+
/** Format refinement, e.g. `'svg'`, `'pdf'` or the source mime type. */
|
|
173
|
+
subtype?: string;
|
|
174
|
+
original_filename?: string;
|
|
175
|
+
width?: number;
|
|
176
|
+
height?: number;
|
|
177
|
+
/** `width / height`, rounded to 4 decimals. */
|
|
178
|
+
aspectRatio?: number;
|
|
179
|
+
/** Dominant color as `#rrggbb` — usable as a loading placeholder. */
|
|
180
|
+
dominant_color?: string;
|
|
181
|
+
/** Up to 5 representative colors, most dominant first (`palette[0] === dominant_color`). */
|
|
182
|
+
palette?: string[];
|
|
183
|
+
/** True for multi-frame GIF/WebP images. */
|
|
184
|
+
animated?: boolean;
|
|
185
|
+
a11y?: B10cksAssetA11y;
|
|
186
|
+
exif?: B10cksAssetExif;
|
|
187
|
+
/** Duration in seconds (video/audio). */
|
|
188
|
+
duration?: number;
|
|
189
|
+
fps?: number;
|
|
190
|
+
bitrate?: number;
|
|
191
|
+
codec?: string;
|
|
192
|
+
thumbnails?: B10cksAssetThumbnail[];
|
|
193
|
+
channels?: number;
|
|
194
|
+
sample_rate?: number;
|
|
195
|
+
tags?: B10cksAssetMediaTags;
|
|
196
|
+
[key: string]: unknown;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/** A generated video preview frame. */
|
|
200
|
+
export declare interface B10cksAssetThumbnail {
|
|
201
|
+
path: string;
|
|
202
|
+
/** Storage-prefixed path, present when delivered via the API. */
|
|
203
|
+
full_path?: string;
|
|
204
|
+
/** Frame position in seconds. */
|
|
205
|
+
position: number;
|
|
206
|
+
/** Frame position as `mm:ss` / `hh:mm:ss`. */
|
|
207
|
+
position_formatted: string;
|
|
208
|
+
/** Dominant color of this frame as `#rrggbb`. */
|
|
209
|
+
dominant_color?: string;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/** An asset field value as delivered inside content payloads. */
|
|
213
|
+
export declare interface B10cksAssetValue {
|
|
214
|
+
type: 'asset';
|
|
215
|
+
id: string;
|
|
216
|
+
url?: string;
|
|
217
|
+
full_path?: string;
|
|
218
|
+
filename?: string;
|
|
219
|
+
extension?: string;
|
|
220
|
+
mime_type?: string;
|
|
221
|
+
size?: number;
|
|
222
|
+
metadata?: B10cksAssetMetadata;
|
|
223
|
+
data?: Record<string, unknown> & {
|
|
224
|
+
focus?: {
|
|
225
|
+
x: number;
|
|
226
|
+
y: number;
|
|
227
|
+
};
|
|
228
|
+
};
|
|
229
|
+
[key: string]: unknown;
|
|
230
|
+
}
|
|
231
|
+
|
|
127
232
|
export declare class B10cksDataApi {
|
|
128
233
|
private readonly client;
|
|
129
234
|
private readonly redirectsCache;
|
|
@@ -706,6 +811,12 @@ export declare namespace types {
|
|
|
706
811
|
IBRedirect,
|
|
707
812
|
IBContentQueryParams,
|
|
708
813
|
B10cksLink,
|
|
814
|
+
B10cksAssetA11y,
|
|
815
|
+
B10cksAssetThumbnail,
|
|
816
|
+
B10cksAssetExif,
|
|
817
|
+
B10cksAssetMediaTags,
|
|
818
|
+
B10cksAssetMetadata,
|
|
819
|
+
B10cksAssetValue,
|
|
709
820
|
B10cksApiClientOptions,
|
|
710
821
|
StringFilter,
|
|
711
822
|
IdFilter,
|