ninja-keys
ninja-keys copied to clipboard
[typescript] type error in react

declare global {
namespace JSX {
interface IntrinsicElements {
'ninja-keys': NinjaKeys
}
}
}
I try to add definitions, but the IDE prompts me for indeed a lot of attributes, including those of HTML elements.

+1 here, thinking about moving to kbar
interface KBarMethods {
open: (opts?: { parent: string }) => void;
close: () => void;
setParent: (parent: string) => void;
}
export interface KBarAction {
id: string;
title: string;
hotkey?: string;
handler?: Function;
mdIcon?: string;
icon?: string;
parent?: string;
keywords?: string;
children?: string[];
section?: string;
}
export interface KBarProps {
hideBreadcrumbs?: boolean,
...
}
type KBar = Pick<HTMLElement, "addEventListener" | "removeEventListener"> &
KBarMethods & KBarProps & { data: KBarAction[] };
declare global {
namespace JSX {
interface IntrinsicElements {
["ninja-keys"]: KBar;
}
}
}
+1
My answer didnt help @williamleiby ?
@wobsoriano, hi do you know how to integrate this into NextJS React app?