Skip to content

Commit

Permalink
fix(root): 🎨 improve typings for TS
Browse files Browse the repository at this point in the history
  • Loading branch information
thierrymichel committed Nov 25, 2019
1 parent b6f2185 commit 48f0637
Show file tree
Hide file tree
Showing 27 changed files with 32 additions and 18 deletions.
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ module.exports = {
collectCoverageFrom: [
'packages/**/src/**/*.ts',
'!packages/**/src/**/*.d.ts',
'!packages/**/src/typings.ts',
'!packages/**/src/**/index.ts',
'!packages/**/src/polyfills/**.ts',
'!packages/core/src/utils/helpers.ts',
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"unpkg": "dist/barba.umd.js",
"module": "dist/barba.mjs",
"source": "src/index.ts",
"types": "dist/core/src/index.d.ts",
"types": "dist/core/src/typings",
"mangle": {
"regex": "^_"
},
Expand Down
10 changes: 5 additions & 5 deletions packages/core/src/defs/barba.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
* @module typings/core
*/

// Core
import { Core } from '../core';
// Modules
import { LogLevels } from '../modules/Logger';
// Definitions
import {
IgnoreOption,
Expand All @@ -10,11 +14,7 @@ import {
IView,
PreventCheck,
RequestCustomError,
} from '.';
// Core
import { Core } from '../core';
// Modules
import { LogLevels } from '../modules/Logger';
} from './index';

export interface IBarbaOptions {
/** Array of transitions. */
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/defs/hooks.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @module typings/core
*/
import { ITransitionData, ITransitionPage, IViewData } from '.';
import { ITransitionData, ITransitionPage, IViewData } from './index';

export type HooksBarba =
| 'ready'
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/defs/prevent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

// Definitions
import { Link } from '.';
import { Link } from './index';
/**
* Available data for all prevent checks.
*
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/defs/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

// Definitions
import { Trigger } from '.';
import { Trigger } from './index';

export type RequestError = (
url: string,
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/defs/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ interface IRouteResolved {
name: string;
params: any;
}
import { IUrlFull } from '.';
import { IUrlFull } from './index';

export type SchemaAttributeValues =
| 'prefix'
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/defs/transition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

// Definitions
import { ISchemaPage, Trigger } from '.';
import { ISchemaPage, Trigger } from './index';

// Data
export interface ITransitionData {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/defs/url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

// Definitions
import { IGenericObject } from '.';
import { IGenericObject } from './index';

export interface IUrlBase {
path: string | undefined;
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/defs/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

// Definitions
import { ISchemaPage, Trigger } from '.';
import { ISchemaPage, Trigger } from './index';

export interface IViewData {
current: ISchemaPage;
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
import * as t from './typings';
export { default } from './core';
2 changes: 2 additions & 0 deletions packages/core/src/typings.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './defs';
export { default } from './core';
2 changes: 1 addition & 1 deletion packages/css/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"unpkg": "dist/barba-css.umd.js",
"module": "dist/barba-css.mjs",
"source": "src/index.ts",
"types": "dist/css/src/index.d.ts",
"types": "dist/css/src/typings",
"mangle": {
"regex": "^_"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/css/src/css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
import { Core } from '@barba/core/src/core';
import { Logger } from '@barba/core/src/modules/Logger';

import { ICssCallbacks } from './defs/css';
import { ICssCallbacks } from './defs';

import { version } from '../package.json';

Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions packages/css/src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
import * as t from './typings';
export { default } from './css';
2 changes: 2 additions & 0 deletions packages/css/src/typings.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './defs';
export { default } from './css';
2 changes: 1 addition & 1 deletion packages/prefetch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"unpkg": "dist/barba-prefetch.umd.js",
"module": "dist/barba-prefetch.mjs",
"source": "src/index.ts",
"types": "dist/prefetch/src/index.d.ts",
"types": "dist/prefetch/src/typings",
"mangle": {
"regex": "^_"
},
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions packages/prefetch/src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
import * as t from './typings';
export { default } from './prefetch';
2 changes: 1 addition & 1 deletion packages/prefetch/src/prefetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @preferred
*/

import { IPrefetchOptions } from './defs/prefetch';
import { IPrefetchOptions } from './defs';

/***/

Expand Down
2 changes: 2 additions & 0 deletions packages/prefetch/src/typings.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './defs';
export { default } from './prefetch';
1 change: 1 addition & 0 deletions packages/router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"unpkg": "dist/barba-router.umd.js",
"module": "dist/barba-router.mjs",
"source": "src/index.ts",
"types": "dist/router/src/typings",
"mangle": {
"regex": "^_"
},
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions packages/router/src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
import * as t from './typings';
export { default } from './router';
2 changes: 1 addition & 1 deletion packages/router/src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { Core } from '@barba/core/src/core';
import { Logger } from '@barba/core/src/modules/Logger';
// Local
import { version } from '../package.json';
import { IRouteByName, IRouteResolved, IRouterOptions } from './defs/router';
import { IRouteByName, IRouteResolved, IRouterOptions } from './defs';

class Router implements IBarbaPlugin<IRouterOptions> {
public name = '@barba/router';
Expand Down
2 changes: 2 additions & 0 deletions packages/router/src/typings.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './defs';
export { default } from './router';

0 comments on commit 48f0637

Please sign in to comment.