mirror of
https://github.com/bendtherules/ts-transformer-visualizer.git
synced 2026-08-19 00:35:13 +00:00
lib - Add node highlighting and consume in log-identifier
This commit is contained in:
@@ -1,22 +1,50 @@
|
||||
import * as ts from "typescript";
|
||||
import { INIT_SOURCEFILE, UPDATE_SOURCEFILE, CLEAR_SOURCEFILE } from "./types";
|
||||
import {
|
||||
INIT_SOURCEFILE,
|
||||
UPDATE_SOURCEFILE,
|
||||
CLEAR_SOURCEFILE,
|
||||
HIGHLIGHT_NODE,
|
||||
CLEAR_HIGHLIGHTED_NODES,
|
||||
InitSourceFileAction,
|
||||
UpdateSourceFileAction,
|
||||
ClearSourceFileAction,
|
||||
HighlightNodeAction,
|
||||
ClearHighlightedNodesAction
|
||||
} from "./types";
|
||||
|
||||
export function initSourceFile(sourceFile: ts.SourceFile) {
|
||||
export function initSourceFile(
|
||||
sourceFile: ts.SourceFile
|
||||
): InitSourceFileAction {
|
||||
return {
|
||||
type: INIT_SOURCEFILE,
|
||||
payload: { sourceFile }
|
||||
};
|
||||
}
|
||||
|
||||
export function updateSourceFile(sourceFile: ts.SourceFile) {
|
||||
export function updateSourceFile(
|
||||
sourceFile: ts.SourceFile
|
||||
): UpdateSourceFileAction {
|
||||
return {
|
||||
type: UPDATE_SOURCEFILE,
|
||||
payload: { sourceFile }
|
||||
};
|
||||
}
|
||||
|
||||
export function clearSourceFile() {
|
||||
export function clearSourceFile(): ClearSourceFileAction {
|
||||
return {
|
||||
type: CLEAR_SOURCEFILE,
|
||||
type: CLEAR_SOURCEFILE
|
||||
};
|
||||
}
|
||||
|
||||
export function highlightNode(node: ts.Node): HighlightNodeAction {
|
||||
return {
|
||||
type: HIGHLIGHT_NODE,
|
||||
payload: { node }
|
||||
};
|
||||
}
|
||||
|
||||
export function clearHighlightedNodes(): ClearHighlightedNodesAction {
|
||||
return {
|
||||
type: CLEAR_HIGHLIGHTED_NODES
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user