@@ -16,18 +16,19 @@ import {
16
16
} from "./annotations"
17
17
import { mergeFocus } from "../utils"
18
18
import { CodeNode , SuperNode } from "./nodes"
19
+ import { CodeHikeConfig } from "./config"
19
20
20
21
export async function transformCodeNodes (
21
22
tree : SuperNode ,
22
- { theme } : { theme : any }
23
+ config : CodeHikeConfig
23
24
) {
24
25
await visitAsync (
25
26
tree ,
26
27
"code" ,
27
28
async ( node : CodeNode , index , parent ) => {
28
29
await transformCode (
29
30
{ node, index, parent : parent ! } ,
30
- { theme }
31
+ config
31
32
)
32
33
}
33
34
)
@@ -43,7 +44,7 @@ export function isEditorNode(node: SuperNode) {
43
44
44
45
async function transformCode (
45
46
nodeInfo : NodeInfo < CodeNode > ,
46
- config : { theme : any }
47
+ config : CodeHikeConfig
47
48
) {
48
49
toJSX ( nodeInfo . node , {
49
50
name : "CH.Code" ,
@@ -52,7 +53,7 @@ async function transformCode(
52
53
}
53
54
export async function transformEditor (
54
55
nodeInfo : NodeInfo ,
55
- config : { theme : any }
56
+ config : CodeHikeConfig
56
57
) {
57
58
toJSX ( nodeInfo . node , {
58
59
name : "CH.Code" ,
@@ -62,7 +63,7 @@ export async function transformEditor(
62
63
63
64
export async function mapAnyCodeNode (
64
65
nodeInfo : NodeInfo ,
65
- config : { theme : any }
66
+ config : CodeHikeConfig
66
67
) {
67
68
const { node } = nodeInfo
68
69
if ( node . type === "code" ) {
@@ -74,7 +75,7 @@ export async function mapAnyCodeNode(
74
75
75
76
async function mapCode (
76
77
nodeInfo : NodeInfo < CodeNode > ,
77
- config : { theme : any }
78
+ config : CodeHikeConfig
78
79
) : Promise < EditorProps > {
79
80
const file = await mapFile ( nodeInfo , config )
80
81
const props : EditorProps = {
@@ -91,7 +92,7 @@ async function mapCode(
91
92
92
93
export async function mapEditor (
93
94
{ node } : NodeInfo ,
94
- config : { theme : any }
95
+ config : CodeHikeConfig
95
96
) : Promise < EditorProps > {
96
97
const [ northNodes , southNodes = [ ] ] = splitChildren (
97
98
node ,
@@ -146,7 +147,7 @@ export async function mapEditor(
146
147
147
148
async function mapFile (
148
149
{ node, index, parent } : NodeInfo < CodeNode > ,
149
- config : { theme : any }
150
+ config : CodeHikeConfig
150
151
) : Promise < CodeStep & FileOptions & { name : string } > {
151
152
const { theme } = config
152
153
0 commit comments