This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"compilerOptions": { | |
"target": "es6", | |
"allowJs": true, | |
"checkJs": true, | |
"moduleResolution": "node", | |
"alwaysStrict": true, | |
"strictNullChecks": false, | |
"emitDeclarationOnly": true, | |
"declaration": true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export { h } from './h' | |
export { render } from './render' | |
export { run } from './runtime' | |
export { union } from './union' | |
export { batchEffects, batch } from './effects' | |
export { Fragment } from './fragment' | |
// Export types for @composi/core: | |
export { VNode, Props } from './vnode' | |
export { Send, Message, State, GetState, Program } from './runtime' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"compilerOptions": { | |
"target": "es6", | |
"jsx": "react", | |
"allowJs": true, | |
"checkJs": true, | |
"noEmit": true, | |
"moduleResolution": "node", | |
"jsxFactory": "h" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Definition for item. */ | |
interface Item { | |
key: number; | |
value: string; | |
} | |
/** The property "items" is an array of type Item. */ | |
interface State { | |
newKey: number; | |
inputValue: string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Definition for item. | |
@typedef {{ | |
key: number, | |
value: string | |
}} Item | |
*/ | |
/** The property `items` is an array of type Item. | |
@typedef {{ | |
newKey: number, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A function that takes two arguments: a name and age. | |
* @param {string} name | |
* @param {number} age | |
* returns {{name: string, age: number} Person object | |
*/ | |
function makePerson(name, age) { | |
return {name, age} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// With type linting this variable will be considered of type 'string': | |
const name = 'Joe' | |
// With type linthing this variable will be considere of type 'number': | |
const age = 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"javascript.implicitProjectConfig.checkJs": true | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @ts-check | |
import {h, render, run} from '@composi/core' | |
import {idb} from '@composi/idb' | |
// Some code here… |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Define generic object. | |
// This can have any number of properties of type any. | |
/** | |
* @typedef {Object<string, any>} Member | |
* @property {string} name The members's name. | |
* @property {number=} age The members's age. | |
* @property {string=} job The member's job. | |
*/ | |
/** | |
* @type {Member} Jack |
NewerOlder