Skip to content

Commit

Permalink
Update to snabbdom 0.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ntilwalli committed Nov 10, 2017
1 parent e93d88d commit c28865b
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"devDependencies": {
"browserify": "^13.1.0",
"disc": "^1.3.2",
"snabbdom": "^0.5.1",
"snabbdom": "^0.7.0",
"standard": "^5.4.1",
"tape": "^4.2.2"
}
Expand Down
5 changes: 3 additions & 2 deletions test/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@

var test = require('tape')
var h = require('snabbdom/h')
var thunk = require('snabbdom/thunk')
var snabbdom = require('snabbdom')
var toHTML = require('../')
var init = require('../init')
var modules = require('../modules')
var h = snabbdom.h
var thunk = snabbdom.thunk

test('Main export', function (t) {
t.equal(typeof toHTML, 'function', 'is function')
Expand Down
35 changes: 26 additions & 9 deletions type-definitions/snabbdom-to-html.d.ts
Original file line number Diff line number Diff line change
@@ -1,52 +1,69 @@
import {VNode} from "snabbdom";
declare module "snabbdom-to-html-common" {
import {VNode} from "snabbdom/vnode"

interface Module {
(vnode: VNode, attributes: Map<string, number | string>): void;
}

export interface Module {
(vnode: VNode, attributes: Map<string, number | string>): void;
interface ModuleIndex {
class: Module;
props: Module;
attributes: Module;
style: Module;
}

export {
VNode,
ModuleIndex,
Module
}
}

declare module "snabbdom-to-html" {
import {VNode} from "snabbdom-to-html-common";
function toHTML(vnode: VNode): string;
export = toHTML
}

declare module "snabbdom-to-html/init" {
import {VNode, Module, ModuleIndex} from "snabbdom-to-html-common";
function init (modules: Module[]): (vnode: VNode) => string;
export = init
}

export interface ModuleIndex {
class: Module;
props: Module;
attributes: Module;
style: Module;
}

declare module "snabbdom-to-html/modules" {
import {ModuleIndex} from "snabbdom-to-html-common";
let modules: ModuleIndex;
export = modules
}

declare module "snabbdom-to-html/modules/index" {
import {ModuleIndex} from "snabbdom-to-html-common";
let modules: ModuleIndex;
export = modules
}

declare module "snabbdom-to-html/modules/attributes" {
import {Module} from "snabbdom-to-html-common";
let attrModule: Module;
export = attrModule;
}

declare module "snabbdom-to-html/modules/class" {
import {Module} from "snabbdom-to-html-common";
let classModule: Module;
export = classModule;
}

declare module "snabbdom-to-html/modules/props" {
import {Module} from "snabbdom-to-html-common";
let propsModule: Module;
export = propsModule;
}

declare module "snabbdom-to-html/modules/style" {
import {Module} from "snabbdom-to-html-common";
let styleModule: Module;
export = styleModule;
}

0 comments on commit c28865b

Please sign in to comment.