UNPKG

@prismicio/types-internal

Version:
16 lines (11 loc) 466 B
import * as t from "io-ts" import { NestedGroup } from "../Group" import { NestableWidget } from "../nestable/NestableWidget" import type { DynamicSlice, StaticSlice } from "./Slice" export const LegacySlice = t.union([NestableWidget, NestedGroup]) export type LegacySlice = t.TypeOf<typeof LegacySlice> export function isLegacySlice( slice: DynamicSlice | StaticSlice, ): slice is LegacySlice { return slice.type !== "Slice" && slice.type !== "SharedSlice" }