Skip to content

Commit

Permalink
Fix types for schema
Browse files Browse the repository at this point in the history
  • Loading branch information
dqbd committed Oct 13, 2023
1 parent 70d7f0d commit cc1e246
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions langserve-playground/src/useSchemas.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
import { useEffect, useState } from "react";

declare global {
interface Window {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
CONFIG_SCHEMA?: any;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
INPUT_SCHEMA?: any;
}
}

export function useSchemas() {
const [schemas, setSchemas] = useState({
config: null,
Expand All @@ -16,8 +25,8 @@ export function useSchemas() {
setSchemas({ config, input });
} else {
setSchemas({
config: window.CONFIG_SCHEMA,
input: window.INPUT_SCHEMA,
config: window.CONFIG_SCHEMA ?? null,
input: window.INPUT_SCHEMA ?? null,
});
}
}
Expand Down

0 comments on commit cc1e246

Please sign in to comment.