Revert "Upgrade linter and formatter to Ultracite" (#1226)
This commit is contained in:
parent
0e320b391d
commit
1aff7d9868
177 changed files with 8334 additions and 6943 deletions
|
|
@ -1,16 +1,16 @@
|
|||
import type { UseChatHelpers } from "@ai-sdk/react";
|
||||
import type { DataUIPart } from "ai";
|
||||
import type { ComponentType, Dispatch, ReactNode, SetStateAction } from "react";
|
||||
import type { Suggestion } from "@/lib/db/schema";
|
||||
import type { ChatMessage, CustomUIDataTypes } from "@/lib/types";
|
||||
import type { UIArtifact } from "./artifact";
|
||||
import type { Suggestion } from '@/lib/db/schema';
|
||||
import type { UseChatHelpers } from '@ai-sdk/react';
|
||||
import type { ComponentType, Dispatch, ReactNode, SetStateAction } from 'react';
|
||||
import type { UIArtifact } from './artifact';
|
||||
import type { ChatMessage, CustomUIDataTypes } from '@/lib/types';
|
||||
import type { DataUIPart } from 'ai';
|
||||
|
||||
export type ArtifactActionContext<M = any> = {
|
||||
content: string;
|
||||
handleVersionChange: (type: "next" | "prev" | "toggle" | "latest") => void;
|
||||
handleVersionChange: (type: 'next' | 'prev' | 'toggle' | 'latest') => void;
|
||||
currentVersionIndex: number;
|
||||
isCurrentVersion: boolean;
|
||||
mode: "edit" | "diff";
|
||||
mode: 'edit' | 'diff';
|
||||
metadata: M;
|
||||
setMetadata: Dispatch<SetStateAction<M>>;
|
||||
};
|
||||
|
|
@ -24,7 +24,7 @@ type ArtifactAction<M = any> = {
|
|||
};
|
||||
|
||||
export type ArtifactToolbarContext = {
|
||||
sendMessage: UseChatHelpers<ChatMessage>["sendMessage"];
|
||||
sendMessage: UseChatHelpers<ChatMessage>['sendMessage'];
|
||||
};
|
||||
|
||||
export type ArtifactToolbarItem = {
|
||||
|
|
@ -33,32 +33,32 @@ export type ArtifactToolbarItem = {
|
|||
onClick: (context: ArtifactToolbarContext) => void;
|
||||
};
|
||||
|
||||
type ArtifactContent<M = any> = {
|
||||
interface ArtifactContent<M = any> {
|
||||
title: string;
|
||||
content: string;
|
||||
mode: "edit" | "diff";
|
||||
mode: 'edit' | 'diff';
|
||||
isCurrentVersion: boolean;
|
||||
currentVersionIndex: number;
|
||||
status: "streaming" | "idle";
|
||||
suggestions: Suggestion[];
|
||||
status: 'streaming' | 'idle';
|
||||
suggestions: Array<Suggestion>;
|
||||
onSaveContent: (updatedContent: string, debounce: boolean) => void;
|
||||
isInline: boolean;
|
||||
getDocumentContentById: (index: number) => string;
|
||||
isLoading: boolean;
|
||||
metadata: M;
|
||||
setMetadata: Dispatch<SetStateAction<M>>;
|
||||
};
|
||||
}
|
||||
|
||||
type InitializeParameters<M = any> = {
|
||||
interface InitializeParameters<M = any> {
|
||||
documentId: string;
|
||||
setMetadata: Dispatch<SetStateAction<M>>;
|
||||
};
|
||||
}
|
||||
|
||||
type ArtifactConfig<T extends string, M = any> = {
|
||||
kind: T;
|
||||
description: string;
|
||||
content: ComponentType<ArtifactContent<M>>;
|
||||
actions: ArtifactAction<M>[];
|
||||
actions: Array<ArtifactAction<M>>;
|
||||
toolbar: ArtifactToolbarItem[];
|
||||
initialize?: (parameters: InitializeParameters<M>) => void;
|
||||
onStreamPart: (args: {
|
||||
|
|
@ -72,7 +72,7 @@ export class Artifact<T extends string, M = any> {
|
|||
readonly kind: T;
|
||||
readonly description: string;
|
||||
readonly content: ComponentType<ArtifactContent<M>>;
|
||||
readonly actions: ArtifactAction<M>[];
|
||||
readonly actions: Array<ArtifactAction<M>>;
|
||||
readonly toolbar: ArtifactToolbarItem[];
|
||||
readonly initialize?: (parameters: InitializeParameters) => void;
|
||||
readonly onStreamPart: (args: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue