@prismicio/types-internal 2.2.0-alpha.11 → 2.2.0-alpha.12
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/package.json +1 -1
- package/lib/import/converters/fields/Slices/SliceItem.d.ts +0 -4
- package/lib/import/converters/fields/Slices/SliceItem.js +0 -24
- package/lib/import/validators/fields/ImportSlices/ImportSliceId.d.ts +0 -9
- package/lib/import/validators/fields/ImportSlices/ImportSliceId.js +0 -43
- package/lib/import/validators/fields/ImportSlices/ImportSliceItem.d.ts +0 -24
- package/lib/import/validators/fields/ImportSlices/ImportSliceItem.js +0 -87
- package/lib/import/validators/fields/ImportSlices/ImportSliceItemContent.d.ts +0 -12
- package/lib/import/validators/fields/ImportSlices/ImportSliceItemContent.js +0 -41
- package/lib/import/validators/fields/Slices/SharedSlice/SharedSlice.d.ts +0 -14
- package/lib/import/validators/fields/Slices/SharedSlice/SharedSlice.js +0 -60
- package/lib/import/validators/fields/Slices/SharedSlice/errors.d.ts +0 -5
- package/lib/import/validators/fields/Slices/SharedSlice/errors.js +0 -8
- package/lib/import/validators/fields/Slices/SharedSlice/fields/OptionalSharedSliceId.d.ts +0 -2
- package/lib/import/validators/fields/Slices/SharedSlice/fields/OptionalSharedSliceId.js +0 -15
- package/lib/import/validators/fields/Slices/SharedSlice/fields/SharedSliceContent/SharedSliceContent.d.ts +0 -17
- package/lib/import/validators/fields/Slices/SharedSlice/fields/SharedSliceContent/SharedSliceContent.js +0 -38
- package/lib/import/validators/fields/Slices/SharedSlice/fields/SharedSliceContent/SharedSliceContentEntry.d.ts +0 -43
- package/lib/import/validators/fields/Slices/SharedSlice/fields/SharedSliceContent/SharedSliceContentEntry.js +0 -69
- package/lib/import/validators/fields/Slices/SharedSlice/fields/SharedSliceContent/errors.d.ts +0 -5
- package/lib/import/validators/fields/Slices/SharedSlice/fields/SharedSliceContent/errors.js +0 -9
- package/lib/import/validators/fields/Slices/SharedSlice/fields/SharedSliceContent/index.d.ts +0 -2
- package/lib/import/validators/fields/Slices/SharedSlice/fields/SharedSliceContent/index.js +0 -5
- package/lib/import/validators/fields/Slices/SharedSlice/fields/SharedSliceContent/types.d.ts +0 -1
- package/lib/import/validators/fields/Slices/SharedSlice/fields/SharedSliceContent/types.js +0 -2
- package/lib/import/validators/fields/Slices/SharedSlice/fields/SharedSliceId.d.ts +0 -9
- package/lib/import/validators/fields/Slices/SharedSlice/fields/SharedSliceId.js +0 -39
- package/lib/import/validators/fields/Slices/SharedSlice/fields/SharedSliceItems.d.ts +0 -11
- package/lib/import/validators/fields/Slices/SharedSlice/fields/SharedSliceItems.js +0 -25
- package/lib/import/validators/fields/Slices/SharedSlice/fields/SharedSliceType.d.ts +0 -11
- package/lib/import/validators/fields/Slices/SharedSlice/fields/SharedSliceType.js +0 -24
- package/lib/import/validators/fields/Slices/SharedSlice/fields/SharedSliceVariation.d.ts +0 -11
- package/lib/import/validators/fields/Slices/SharedSlice/fields/SharedSliceVariation.js +0 -24
- package/lib/import/validators/fields/Slices/SharedSlice/fields/index.d.ts +0 -6
- package/lib/import/validators/fields/Slices/SharedSlice/fields/index.js +0 -9
- package/lib/import/validators/fields/Slices/SharedSlice/index.d.ts +0 -3
- package/lib/import/validators/fields/Slices/SharedSlice/index.js +0 -6
- package/lib/import/validators/fields/Slices/SharedSlice/utils.d.ts +0 -339
- package/lib/import/validators/fields/Slices/SharedSlice/utils.js +0 -11
- package/lib/import/validators/fields/Slices/Slices.d.ts +0 -8
- package/lib/import/validators/fields/Slices/Slices.js +0 -29
- package/lib/import/validators/fields/Slices/index.d.ts +0 -1
- package/lib/import/validators/fields/Slices/index.js +0 -4
- package/lib/import/validators/fields/Slices/utils.d.ts +0 -4
- package/lib/import/validators/fields/Slices/utils.js +0 -35
- package/lib/import/validators/fields/Slices.d.ts +0 -4
- package/lib/import/validators/fields/Slices.js +0 -12
- package/lib/import/validators/fields/nestable/Image.d.ts +0 -45
- package/lib/import/validators/fields/nestable/Image.js +0 -45
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import * as t from "io-ts";
|
|
2
|
-
declare const ImageFieldCodec: t.Type<{
|
|
3
|
-
id: string;
|
|
4
|
-
} & {
|
|
5
|
-
edit?: {
|
|
6
|
-
x: number;
|
|
7
|
-
y: number;
|
|
8
|
-
width: number;
|
|
9
|
-
height: number;
|
|
10
|
-
zoom: number;
|
|
11
|
-
background: string;
|
|
12
|
-
};
|
|
13
|
-
credit?: string | null;
|
|
14
|
-
alt?: string | null;
|
|
15
|
-
}, {
|
|
16
|
-
[x: string]: unknown;
|
|
17
|
-
}, unknown>;
|
|
18
|
-
declare const ThumbnailsCodec: t.RecordC<t.StringC, t.Type<{
|
|
19
|
-
id: string;
|
|
20
|
-
} & {
|
|
21
|
-
edit?: {
|
|
22
|
-
x: number;
|
|
23
|
-
y: number;
|
|
24
|
-
width: number;
|
|
25
|
-
height: number;
|
|
26
|
-
zoom: number;
|
|
27
|
-
background: string;
|
|
28
|
-
};
|
|
29
|
-
credit?: string | null;
|
|
30
|
-
alt?: string | null;
|
|
31
|
-
}, {
|
|
32
|
-
[x: string]: unknown;
|
|
33
|
-
}, unknown>>;
|
|
34
|
-
declare type Thumbnails = t.TypeOf<typeof ThumbnailsCodec>;
|
|
35
|
-
export declare type ImageField = t.TypeOf<typeof ImageFieldCodec>;
|
|
36
|
-
declare type ImageFieldWithThumbnails = ImageField & {
|
|
37
|
-
thumbnails: Thumbnails;
|
|
38
|
-
};
|
|
39
|
-
declare const ImageFieldWithThumbnails: t.Type<ImageFieldWithThumbnails, ImageFieldWithThumbnails, unknown>;
|
|
40
|
-
export declare const ImportImage: t.Type<{
|
|
41
|
-
type: "Image";
|
|
42
|
-
value: ImageFieldWithThumbnails | null;
|
|
43
|
-
}, ImageFieldWithThumbnails | undefined, unknown>;
|
|
44
|
-
export declare type ImportImage = t.TypeOf<typeof ImportImage>;
|
|
45
|
-
export {};
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ImportImage = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const Either_1 = require("fp-ts/Either");
|
|
6
|
-
const function_1 = require("fp-ts/lib/function");
|
|
7
|
-
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
8
|
-
const Objects_1 = require("../../../../utils/Objects");
|
|
9
|
-
const validators_1 = require("../../../../validators");
|
|
10
|
-
const BasicTypes_1 = require("../../../../validators/BasicTypes");
|
|
11
|
-
const ImportContent_1 = require("../ImportContent");
|
|
12
|
-
const ImageFieldCodec = validators_1.AnyObject.pipe(t.intersection([
|
|
13
|
-
t.type({
|
|
14
|
-
id: BasicTypes_1.String,
|
|
15
|
-
}),
|
|
16
|
-
t.partial({
|
|
17
|
-
edit: validators_1.AnyObject.pipe(t.strict({
|
|
18
|
-
x: validators_1.Number,
|
|
19
|
-
y: validators_1.Number,
|
|
20
|
-
width: validators_1.Number,
|
|
21
|
-
height: validators_1.Number,
|
|
22
|
-
zoom: validators_1.Number,
|
|
23
|
-
background: BasicTypes_1.String,
|
|
24
|
-
})),
|
|
25
|
-
credit: BasicTypes_1.StringOrNull,
|
|
26
|
-
alt: BasicTypes_1.StringOrNull,
|
|
27
|
-
}),
|
|
28
|
-
]));
|
|
29
|
-
const ThumbnailsCodec = t.record(t.string, ImageFieldCodec);
|
|
30
|
-
const ImageFieldWithThumbnails = new t.Type("ImageFieldWithThumbnails", (u) => ImageFieldCodec.is(u) &&
|
|
31
|
-
"thumbnails" in u &&
|
|
32
|
-
ThumbnailsCodec.is(u["thumbnails"]), (u, ctx) => {
|
|
33
|
-
return (0, function_1.pipe)(ImageFieldCodec.validate(u, ctx), (0, Either_1.chain)((proto) => {
|
|
34
|
-
const { id, edit, credit, alt, ...maybeThumbnails } = proto;
|
|
35
|
-
return (0, function_1.pipe)(ThumbnailsCodec.validate(maybeThumbnails, ctx), (0, Either_1.map)((thumbnails) => (0, Objects_1.withOptionals)({
|
|
36
|
-
id,
|
|
37
|
-
thumbnails,
|
|
38
|
-
}, [
|
|
39
|
-
["edit", edit],
|
|
40
|
-
["credit", credit],
|
|
41
|
-
["alt", alt],
|
|
42
|
-
])));
|
|
43
|
-
}));
|
|
44
|
-
}, t.identity);
|
|
45
|
-
exports.ImportImage = (0, ImportContent_1.ImportContent)("Image", (0, validators_1.NullOrElse)(ImageFieldWithThumbnails));
|