Skip to content

Commit

Permalink
fix typecheck
Browse files Browse the repository at this point in the history
  • Loading branch information
Frizi committed Dec 19, 2024
1 parent 3c8d1b2 commit a3c8078
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 49 deletions.
2 changes: 1 addition & 1 deletion app/gui/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ js_run_binary(
visibility = ["//visibility:public"],
)

# TODO: Make env replacement a separate post-build step.
# TODO: Maybe make env replacement a separate post-build step, TBD.
# js_binary(
# name = "script_env_replacer",
# entry_point = "scripts/envReplacer.mjs",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export function DashboardTabPanels(props: DashboardTabPanelsProps) {

return (
<Collection items={tabPanels}>
{(tabPanelProps) => (
{(tabPanelProps: aria.TabPanelProps) => (
<Suspense>
<ErrorBoundary>
<aria.TabPanel {...tabPanelProps} />
Expand Down
47 changes: 46 additions & 1 deletion app/ydoc-shared/src/ast/ensoMarkdown.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TreeCursor } from '@lezer/common'
import { Tree, TreeBuffer, TreeCursor } from '@lezer/common'
import {
type BlockContext,
type BlockParser,
Expand All @@ -15,6 +15,51 @@ import {
} from '@lezer/markdown'
import { assertDefined } from '../util/assert'

/**
* Private lezer-markdown symbols used by lezer-markdown parsers we have customized versions of.
*/
declare module '@lezer/markdown' {
export interface BlockContext {
block: CompositeBlock
stack: CompositeBlock[]
readonly buffer: Buffer

addNode: (block: number | Tree, from: number, to?: number) => void
startContext: (type: number, start: number, value?: number) => void
}

export interface CompositeBlock {
readonly type: number
// Used for indentation in list items, markup character in lists
readonly value: number
readonly from: number
readonly hash: number
end: number
readonly children: (Tree | TreeBuffer)[]
readonly positions: number[]
}

export interface Buffer {
content: number[]
nodes: Tree[]

write: (type: number, from: number, to: number, children?: number) => Buffer
writeElements: (elts: readonly Element[], offset?: number) => Buffer
finish: (type: number, length: number) => Tree
}

export interface InlineDelimiter {
readonly type: DelimiterType
readonly from: number
readonly to: number
side: Mark
}

export interface InlineContext {
parts: (Element | InlineDelimiter | null)[]
}
}

function getType({ parser }: { parser: MarkdownParser }, name: string) {
const ty = parser.nodeSet.types.find(ty => ty.name === name)
assertDefined(ty)
Expand Down
46 changes: 0 additions & 46 deletions app/ydoc-shared/src/ast/lezerMarkdown.d.ts

This file was deleted.

0 comments on commit a3c8078

Please sign in to comment.