Use the already defined type for AppendTarget

pull/2604/head
thollander 5 years ago committed by Conduitry
parent 831926bccd
commit c965abc884

@ -11,7 +11,7 @@ import Slot from './handlers/Slot';
import Tag from './handlers/Tag'; import Tag from './handlers/Tag';
import Text from './handlers/Text'; import Text from './handlers/Text';
import Title from './handlers/Title'; import Title from './handlers/Title';
import { CompileOptions } from '../../interfaces'; import { AppendTarget, CompileOptions } from '../../interfaces';
type Handler = (node: any, renderer: Renderer, options: CompileOptions) => void; type Handler = (node: any, renderer: Renderer, options: CompileOptions) => void;
@ -36,8 +36,6 @@ const handlers: Record<string, Handler> = {
Window: noop Window: noop
}; };
type AppendTarget = any; // TODO
export default class Renderer { export default class Renderer {
has_bindings = false; has_bindings = false;
code = ''; code = '';

@ -4,8 +4,7 @@ import { snip } from '../../utils/snip';
import Renderer from '../Renderer'; import Renderer from '../Renderer';
import { stringify_props } from '../../utils/stringify_props'; import { stringify_props } from '../../utils/stringify_props';
import { get_slot_scope } from './shared/get_slot_scope'; import { get_slot_scope } from './shared/get_slot_scope';
import { AppendTarget } from '../../../interfaces';
type AppendTarget = any; // TODO
function stringify_attribute(chunk: Node) { function stringify_attribute(chunk: Node) {
if (chunk.type === 'Text') { if (chunk.type === 'Text') {
@ -111,4 +110,4 @@ export default function(node, renderer: Renderer, options) {
const slots = stringify_props(slot_fns); const slots = stringify_props(slot_fns);
renderer.append(`\${@validate_component(${expression}, '${node.name}').$$render($$result, ${props}, ${bindings}, ${slots})}`); renderer.append(`\${@validate_component(${expression}, '${node.name}').$$render($$result, ${props}, ${bindings}, ${slots})}`);
} }

Loading…
Cancel
Save