Sanity Library Reference Docs
    Preparing search index...

    Type Alias CreateDataAttribute<T>

    CreateDataAttribute: (
        T extends WithRequired<CreateDataAttributeProps, "id" | "type" | "path">
            ? { toString(): string; (path?: StudioPathLike): string }
            : T extends WithRequired<CreateDataAttributeProps, "id" | "type">
                ? (path: StudioPathLike) => string
                : object
    ) & {
        combine: <U extends CreateDataAttributeProps>(
            props: U,
        ) => CreateDataAttribute<T & U>;
        scope(
            path: StudioPathLike,
        ): CreateDataAttribute<T & { path: StudioPathLike }>;
    }

    Type Parameters

    Type declaration

    • combine: <U extends CreateDataAttributeProps>(props: U) => CreateDataAttribute<T & U>

      Combines the current props with additional props

    • scope: function
      • Concatenate the current path with a new path

        Parameters

        • path: StudioPathLike

          A path to concatenate with any existing path

        Returns CreateDataAttribute<T & { path: StudioPathLike }>