Skip to content

Commit

Permalink
feat: re-export Element from @prismicio/richtext
Browse files Browse the repository at this point in the history
This makes writing a Rich Text serializer easier.
  • Loading branch information
angeloashmore committed Nov 24, 2021
1 parent 9d6f366 commit ae79fd6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/index.ts
Expand Up @@ -17,6 +17,14 @@ export type { PrismicTextProps } from "./PrismicText";
export { PrismicRichText } from "./PrismicRichText";
export type { PrismicRichTextProps } from "./PrismicRichText";

import { Element } from "@prismicio/richtext";
export { Element };
/**
* @deprecated Renamed to `Element` (without an "s").
*/
// TODO: Remove in v3.
export const Elements = Element;

export { SliceZone, TODOSliceComponent } from "./SliceZone";
export type {
SliceComponentProps,
Expand Down
13 changes: 13 additions & 0 deletions test/index.test.ts
@@ -0,0 +1,13 @@
import test from "ava";
import * as prismicR from "@prismicio/richtext";

import * as prismicH from "../src";

test("Element is an alias for @prismicio/richtext's Element", (t) => {
t.is(prismicH.Element, prismicR.Element);
});

// TODO: Remove in v3.
test("Elements is a temporary alias for Element", (t) => {
t.is(prismicH.Elements, prismicH.Element);
});

0 comments on commit ae79fd6

Please sign in to comment.