Skip to content

Commit

Permalink
build(types): use sanity's ScheduledPublishingPluginOptions and BetaF…
Browse files Browse the repository at this point in the history
…eatures types

sanity-io/sanity#7637
  • Loading branch information
saiichihashimoto committed Nov 5, 2024
1 parent 71b09ce commit 45caff9
Showing 1 changed file with 4 additions and 32 deletions.
36 changes: 4 additions & 32 deletions packages/types/src/internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ import {
} from "sanity";
import type {
ArrayDefinition as ArrayDefinitionNative,
ArrayRule, // @ts-expect-error TODO Until sanity exports BetaFeatures, we'll get TS4023 https://github.com/sanity-io/sanity/issues/7637
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- TODO Until sanity exports BetaFeatures, we'll get TS4023 https://github.com/sanity-io/sanity/issues/7637
BetaFeatures as BetaFeaturesNative,
ArrayRule,
BetaFeatures,
BlockDecoratorDefinition as BlockDecoratorDefinitionNative,
BlockDefinition as BlockDefinitionNative,
BlockListDefinition as BlockListDefinitionNative,
Expand Down Expand Up @@ -55,8 +54,7 @@ import type {
ReferenceDefinition as ReferenceDefinitionNative,
ReferenceRule,
ReferenceValue as ReferenceValueNative,
RuleDef, // @ts-expect-error TODO Until sanity exports ScheduledPublishingPluginOptions, we'll get TS4023 https://github.com/sanity-io/sanity/issues/7637
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- TODO Until sanity exports ScheduledPublishingPluginOptions, we'll get TS4023 https://github.com/sanity-io/sanity/issues/7637
RuleDef,
ScheduledPublishingPluginOptions,
SchemaPluginOptions as SchemaPluginOptionsNative,
SlugDefinition as SlugDefinitionNative,
Expand Down Expand Up @@ -1194,21 +1192,6 @@ export type ConfigBase<
>;
};

// TODO Until sanity exports BetaFeatures, we'll get TS4023 https://github.com/sanity-io/sanity/issues/7637
type BetaFeatures = {
/**
* @beta
* @hidden
* @deprecated beta feature is no longer available.
* */
treeArrayEditing?: {
/**
* @deprecated beta feature is no longer available.
*/
enabled: boolean;
};
};

export type PluginOptions<
TTypeDefinition extends TypeDefinition<
any,
Expand Down Expand Up @@ -1285,18 +1268,7 @@ type WorkspaceOptions<
Omit<WorkspaceOptionsNative, "beta">,
ConfigBase<TTypeDefinition, TPluginOptions> & {
beta?: BetaFeatures;
// TODO Until sanity exports ScheduledPublishingPluginOptions, we'll get TS4023 https://github.com/sanity-io/sanity/issues/7637
scheduledPublishing?: {
/**
* Whether scheduled publishing is enabled for this workspace.
*/
enabled: boolean;
/**
* Date format to use for input fields. This must be a valid `date-fns` {@link https://date-fns.org/docs/format | formatted string}.
* @defaultValue 'dd/MM/yyyy HH:mm' make sure to specify minutes and hours if you are specifying a custom format
*/
inputDateTimeFormat?: string;
};
scheduledPublishing?: ScheduledPublishingPluginOptions;
}
>;

Expand Down

0 comments on commit 45caff9

Please sign in to comment.