Skip to content

Commit

Permalink
chore: fix FoamTree type error
Browse files Browse the repository at this point in the history
  • Loading branch information
mengdaoshizhongxinyang committed Oct 16, 2023
1 parent fc9bec4 commit 7ddcfdf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/client/components/tree-map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function getChunkNamePart(chunkLabel: string, chunkNamePartIndex: number) {
export function TreeMap() {
const { foamModule, sizes } = useApplicationContext()
const containerRef = useRef<HTMLDivElement>(null)
const foamTreeInstance = useRef<FoamTree>(null)
const foamTreeInstance = useRef<FoamTree | null>(null)

const [chunkNamePartIndex, setChunkNamePartIndex] = useState<number>(0)

Expand Down
7 changes: 3 additions & 4 deletions src/client/third.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ declare module '@carrotsearch/foamtree' {
hasChildren: boolean
}

export interface FoamContext {
export abstract class FoamContext {
zoom(group: FoamDataObject): void
resize(): void
discope(): void
Expand Down Expand Up @@ -112,10 +112,9 @@ declare module '@carrotsearch/foamtree' {

export type FoamGroupClickEvent = (this: FoamContext, event: FoamEventObject)=> void

declare class FoamTree implements FoamContext {
export class FoamTree extends FoamContext {
constructor(opts: Partial<FoamTreeOptions>)
}

export { FoamTree }

export default FoamTree
}

0 comments on commit 7ddcfdf

Please sign in to comment.