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,40 +1,40 @@
|
|||
import type { UIMessageStreamWriter } from "ai";
|
||||
import type { Session } from "next-auth";
|
||||
import { codeDocumentHandler } from "@/artifacts/code/server";
|
||||
import { sheetDocumentHandler } from "@/artifacts/sheet/server";
|
||||
import { textDocumentHandler } from "@/artifacts/text/server";
|
||||
import type { ArtifactKind } from "@/components/artifact";
|
||||
import { saveDocument } from "../db/queries";
|
||||
import type { Document } from "../db/schema";
|
||||
import type { ChatMessage } from "../types";
|
||||
import { codeDocumentHandler } from '@/artifacts/code/server';
|
||||
import { sheetDocumentHandler } from '@/artifacts/sheet/server';
|
||||
import { textDocumentHandler } from '@/artifacts/text/server';
|
||||
import type { ArtifactKind } from '@/components/artifact';
|
||||
import type { Document } from '../db/schema';
|
||||
import { saveDocument } from '../db/queries';
|
||||
import type { Session } from 'next-auth';
|
||||
import type { UIMessageStreamWriter } from 'ai';
|
||||
import type { ChatMessage } from '../types';
|
||||
|
||||
export type SaveDocumentProps = {
|
||||
export interface SaveDocumentProps {
|
||||
id: string;
|
||||
title: string;
|
||||
kind: ArtifactKind;
|
||||
content: string;
|
||||
userId: string;
|
||||
};
|
||||
}
|
||||
|
||||
export type CreateDocumentCallbackProps = {
|
||||
export interface CreateDocumentCallbackProps {
|
||||
id: string;
|
||||
title: string;
|
||||
dataStream: UIMessageStreamWriter<ChatMessage>;
|
||||
session: Session;
|
||||
};
|
||||
}
|
||||
|
||||
export type UpdateDocumentCallbackProps = {
|
||||
export interface UpdateDocumentCallbackProps {
|
||||
document: Document;
|
||||
description: string;
|
||||
dataStream: UIMessageStreamWriter<ChatMessage>;
|
||||
session: Session;
|
||||
};
|
||||
}
|
||||
|
||||
export type DocumentHandler<T = ArtifactKind> = {
|
||||
export interface DocumentHandler<T = ArtifactKind> {
|
||||
kind: T;
|
||||
onCreateDocument: (args: CreateDocumentCallbackProps) => Promise<void>;
|
||||
onUpdateDocument: (args: UpdateDocumentCallbackProps) => Promise<void>;
|
||||
};
|
||||
}
|
||||
|
||||
export function createDocumentHandler<T extends ArtifactKind>(config: {
|
||||
kind: T;
|
||||
|
|
@ -89,10 +89,10 @@ export function createDocumentHandler<T extends ArtifactKind>(config: {
|
|||
/*
|
||||
* Use this array to define the document handlers for each artifact kind.
|
||||
*/
|
||||
export const documentHandlersByArtifactKind: DocumentHandler[] = [
|
||||
export const documentHandlersByArtifactKind: Array<DocumentHandler> = [
|
||||
textDocumentHandler,
|
||||
codeDocumentHandler,
|
||||
sheetDocumentHandler,
|
||||
];
|
||||
|
||||
export const artifactKinds = ["text", "code", "sheet"] as const;
|
||||
export const artifactKinds = ['text', 'code', 'sheet'] as const;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue