UNPKG

sanity-plugin-utils

Version:
88 lines 2.85 kB
import { CardProps, CardTone } from "@sanity/ui"; import { PropsWithChildren, ReactNode } from "react"; import { ImageUrlBuilder, ListenQueryOptions, ListenQueryParams, SourceClientOptions } from "sanity"; import { SanityImageSource } from "@sanity/asset-utils"; type FeedbackChildren = { children?: ReactNode; title?: never; description?: never; }; type FeedbackTextProps = { title?: string; description?: ReactNode; children?: never; }; type FeedbackProps = (FeedbackChildren | FeedbackTextProps) & { tone?: CardTone; icon?: ReactNode; }; declare function Feedback(props: FeedbackProps): import("react").JSX.Element; type TableProps = PropsWithChildren<CardProps>; declare function Table(props: TableProps): import("react").JSX.Element; type TableRowProps = PropsWithChildren<CardProps>; declare function Row(props: TableRowProps): import("react").JSX.Element; type TableCellProps = PropsWithChildren<CardProps & { colSpan?: number; rowSpan?: number; }>; declare function Cell(props: TableCellProps): import("react").JSX.Element; type UserRole = { name: string; title: string; }; type UserExtended = { createdAt: string; displayName: string; email: string; familyName: string; givenName: string; id: string; imageUrl: string; isCurrentUser: boolean; middleName: string; projectId: string; provider: string; roles?: UserRole[]; sanityUserId: string; updatedAt: string; }; type HookConfig = { apiVersion?: string; }; declare function useProjectUsers({ apiVersion }: HookConfig): UserExtended[]; type Labels = { addMe?: string; removeMe?: string; clear?: string; searchPlaceholder?: string; notFound?: string; }; type UserSelectMenuProps = { value: string[]; userList: UserExtended[]; onAdd: (userId: string) => void; onRemove: (userId: string) => void; onClear: () => void; labels?: Labels; style?: React.CSSProperties; }; declare function UserSelectMenu(props: UserSelectMenuProps): import("react").JSX.Element; declare function useImageUrlBuilder(clientOptions: SourceClientOptions): ImageUrlBuilder | null; declare function useImageUrlBuilderImage(source: SanityImageSource, clientOptions: SourceClientOptions): ImageUrlBuilder | null; interface Config<V> { params?: ListenQueryParams; options?: ListenQueryOptions; initialValue?: null | V; } interface Return<V> { loading: boolean; error: unknown; data: V | null; } declare function useListeningQuery<V>(query: string | { fetch: string; listen: string; }, { params, options, initialValue }: Config<V>): Return<V>; declare function useOpenInNewPane(id?: string, type?: string): () => void; export { Cell, Feedback, Row, Table, type UserExtended, UserSelectMenu, useImageUrlBuilder, useImageUrlBuilderImage, useListeningQuery, useOpenInNewPane, useProjectUsers }; //# sourceMappingURL=index.d.ts.map