Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "roamjs-components",
"description": "Expansive toolset, utilities, & components for developing RoamJS extensions.",
"version": "0.86.7",
"version": "0.87.0",
"main": "index.js",
"types": "index.d.ts",
"scripts": {
Expand Down
52 changes: 43 additions & 9 deletions src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,23 @@ export type Registry = {
type: keyof WindowEventMap;
listener: (
this: Window,
ev: WindowEventMap[keyof WindowEventMap]
ev: WindowEventMap[keyof WindowEventMap],
) => void;
}
| {
el: Document;
type: keyof DocumentEventMap;
listener: (
this: Document,
ev: DocumentEventMap[keyof DocumentEventMap]
ev: DocumentEventMap[keyof DocumentEventMap],
) => void;
}
| {
el: HTMLElement;
type: keyof HTMLElementEventMap | `roamjs:${string}`;
listener: (
this: HTMLElement,
ev: HTMLElementEventMap[keyof HTMLElementEventMap]
ev: HTMLElementEventMap[keyof HTMLElementEventMap],
) => void;
}
)[];
Expand All @@ -71,7 +71,7 @@ declare global {
identifiers: (M: unknown) => unknown;
initialEnvironment: { values: unknown; functions: unknown };
repl: (
fmt: (M: unknown) => unknown
fmt: (M: unknown) => unknown,
) => (env: {
values: unknown;
functions: unknown;
Expand All @@ -84,7 +84,7 @@ declare global {
q: (query: string, ...params: unknown[]) => unknown[][];
pull: (
selector: string,
id: number | string | [string, string]
id: number | string | [string, string],
) => PullBlock;
createBlock: WriteAction;
updateBlock: WriteAction;
Expand Down Expand Up @@ -119,11 +119,11 @@ declare global {
q: (query: string, ...params: unknown[]) => Promise<unknown[][]>;
pull: (
selector: string,
id: number | string | [string, string]
id: number | string | [string, string],
) => Promise<PullBlock>;
pull_many: (
pattern: string,
eids: string[][]
eids: string[][],
) => Promise<PullBlock[]>;
fast: {
q: (query: string, ...params: unknown[]) => Promise<unknown[][]>;
Expand All @@ -139,14 +139,14 @@ declare global {
};
pull: (
selector: string,
id: number | string | [string, string]
id: number | string | [string, string],
) => PullBlock;
pull_many: (pattern: string, eids: string[][]) => PullBlock[];
q: (query: string, ...params: unknown[]) => unknown[][];
removePullWatch: (
pullPattern: string,
entityId: string,
callback?: (before: PullBlock, after: PullBlock) => void
callback?: (before: PullBlock, after: PullBlock) => void,
) => boolean;
redo: () => void;
undo: () => void;
Expand Down Expand Up @@ -277,6 +277,39 @@ declare global {
}) => Promise<null>;
unmountNode: (args: { el: HTMLElement }) => Promise<null>;
};
react: {
Block: (props: {
uid: string;
open?: boolean;
zoomPath?: boolean;
zoomStartAfterUid?: string;
}) => JSX.Element;
Page: (props:
| {
uid: string;
title?: never;
hideMentions?: boolean;
}
| {
uid?: never;
title: string;
hideMentions?: boolean;
}) => JSX.Element;
Search: (props: {
searchQueryStr: string;
closed?: boolean;
groupByPage?: boolean;
hidePaths?: boolean;
onConfigChange?: (config: {
closed?: boolean;
groupByPage?: boolean;
hidePaths?: boolean;
}) => void;
}) => JSX.Element;
BlockString: (props: {
string: string;
}) => JSX.Element;
};
graphView: {
addCallback: (props: {
label: string;
Expand Down Expand Up @@ -370,3 +403,4 @@ declare global {
};
}
}