Commit e1bbf8ea by James Ooi

Enable typing emits

parent 617ec396
{
"name": "foresight",
"version": "0.1.0",
"main": "index.js",
"main": "dist/foresight.js",
"typings": "typings/foresight.d.ts",
"author": "James Ooi <wengteikooi@gmail.com>",
"license": "MIT",
"devDependencies": {
......
{
"compilerOptions": {
"target": "es5",
"allowJs": true,
"allowJs": false,
"noImplicitAny": false,
"removeComments": true,
"lib": ["es6", "dom"]
......
{
"compilerOptions": {
"target": "es5",
"declaration": true,
"declarationDir": "./typings",
"allowJs": false,
"noImplicitAny": false,
"removeComments": true,
"lib": ["es6", "dom"]
},
"exclude": [
"node_modules",
"**/node_modules/*"
]
}
\ No newline at end of file
import 'intersection-observer';
interface ForesightConfig {
observerOptions?: IntersectionObserverInit;
nonInteractionClicks?: boolean;
nonInteractionViews?: boolean;
}
declare class Foresight {
static defaultOptions: Partial<ForesightConfig>;
options: ForesightConfig;
private _untrackFns;
private _observer;
constructor(config: ForesightConfig);
start(root?: Element): void;
track(element: Element): void;
untrack(element: Element): void;
private _parseEventString;
private _trackClicks;
private _trackViews;
private _onTrackedClick;
private _onTrackedView;
}
export = Foresight;
export { default as toArray } from './toArray';
export default function toArray<T>(arrayLike: any): T[];
......@@ -28,7 +28,12 @@ const config = {
{
test: /\.tsx?$/,
exclude: /node_modules/,
use: ['awesome-typescript-loader'],
use: {
loader: 'awesome-typescript-loader',
options: {
configFileName: isProduction ? 'tsconfig.prod.json' : 'tsconfig.json'
}
},
}
]
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment