2023-01-02 16:00:42 -05:00
|
|
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
2021-07-08 09:43:36 -04:00
|
|
|
|
|
|
|
/// <reference no-default-lib="true" />
|
|
|
|
/// <reference lib="esnext" />
|
|
|
|
|
2023-04-30 05:11:37 -04:00
|
|
|
declare module "ext:deno_console/01_console.js" {
|
2023-02-07 14:22:46 -05:00
|
|
|
function createFilteredInspectProxy<TObject>(params: {
|
|
|
|
object: TObject;
|
|
|
|
keys: (keyof TObject)[];
|
|
|
|
evaluate: boolean;
|
|
|
|
}): Record<string, unknown>;
|
2021-07-08 09:43:36 -04:00
|
|
|
}
|
2023-09-29 12:57:08 -04:00
|
|
|
|
|
|
|
declare module "ext:deno_console/02_jsx.js" {
|
|
|
|
import { JSXSerializeAdapter, SharedVNode } from "ext:deno_console/jsx";
|
|
|
|
|
|
|
|
export const reactAdapter: JSXSerializeAdapter;
|
|
|
|
export const preactAdapter: JSXSerializeAdapter;
|
|
|
|
|
|
|
|
export function serialize(
|
|
|
|
adapter: JSXSerializeAdapter,
|
|
|
|
vnode: SharedVNode,
|
|
|
|
level: number,
|
|
|
|
limit: number
|
|
|
|
): string;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare module "ext:deno_console/jsx" {
|
|
|
|
export interface ComponentFunction<T = unknown> {
|
|
|
|
(props: T): VElement;
|
|
|
|
displayName?: string;
|
|
|
|
contenxtType?: {
|
|
|
|
displayName?: string;
|
|
|
|
Provider?: (props: unknown) => VElement;
|
|
|
|
Consumer?: (props: unknown) => VElement;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export type VChild =
|
|
|
|
| string
|
|
|
|
| number
|
|
|
|
| null
|
|
|
|
| undefined
|
|
|
|
// deno-lint-ignore ban-types
|
|
|
|
| Function
|
|
|
|
| SharedVNode;
|
|
|
|
export type VElement = VChild | VElement[] | Iterable<VElement>;
|
|
|
|
export type NormalizedChild =
|
|
|
|
| string
|
|
|
|
// deno-lint-ignore ban-types
|
|
|
|
| Function
|
|
|
|
| SharedVNode
|
|
|
|
| NormalizedChild[];
|
|
|
|
|
|
|
|
export interface PreactComponentInstance {
|
|
|
|
sub?: unknown;
|
|
|
|
displayName?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface SharedVNode {
|
|
|
|
$$typeof?: symbol;
|
|
|
|
// In Preact "null" means text and "props.data" is the text.
|
|
|
|
// In React symbols are for special nodes like Fragments
|
|
|
|
type:
|
|
|
|
| string
|
|
|
|
| ComponentFunction
|
|
|
|
| null
|
|
|
|
| number
|
|
|
|
| symbol
|
|
|
|
// React
|
|
|
|
| {
|
|
|
|
$$typeof: symbol;
|
|
|
|
displayName?: string;
|
|
|
|
type: ComponentFunction;
|
|
|
|
render?: ComponentFunction;
|
|
|
|
};
|
|
|
|
props: Record<string, unknown>;
|
|
|
|
key: null | undefined | number | string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface JSXSerializeAdapter {
|
|
|
|
getTextIfTextNode(x: SharedVNode): string | null;
|
|
|
|
isFragment(x: SharedVNode): boolean;
|
|
|
|
getName(x: SharedVNode): string;
|
|
|
|
isValidElement(x: unknown): x is SharedVNode;
|
|
|
|
}
|
|
|
|
}
|