From 57e3e27d08cf52dc2b2f0af4cff2e85be6f3adc6 Mon Sep 17 00:00:00 2001 From: Kyle Corbelli Date: Sun, 3 Sep 2017 06:41:20 -0700 Subject: [PATCH] Try adding types again --- dist/actions.js | 1 - dist/actions.js.map | 2 +- dist/reducers/index.js.map | 2 +- dist/types.js | 1 - dist/types.js.map | 2 +- index.d.ts | 6 ++++++ package-lock.json | 2 +- package.json | 3 ++- src/actions.ts | 5 ++--- src/reducers/index.ts | 7 +++++-- src/types.ts | 11 ++++++++++- 11 files changed, 29 insertions(+), 13 deletions(-) create mode 100644 index.d.ts diff --git a/dist/actions.js b/dist/actions.js index 9d3434d..330e18c 100644 --- a/dist/actions.js +++ b/dist/actions.js @@ -89,7 +89,6 @@ exports.signOutRequestFailed = function () { return ({ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Async Redux Thunk actions: //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Maybe type this even: var theActionsExportThatShouldBeRenamed = function (authUrl) { var registerUser = function (userRegistrationDetails) { return function (dispatch) { return __awaiter(this, void 0, void 0, function () { diff --git a/dist/actions.js.map b/dist/actions.js.map index 540787b..8599a2f 100644 --- a/dist/actions.js.map +++ b/dist/actions.js.map @@ -1 +1 @@ -{"version":3,"file":"actions.js","sourceRoot":"","sources":["../src/actions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAyB;AAGzB,iCA+BgB;AAChB,wCAKwB,CAAC,kHAAkH;AAE3I,wHAAwH;AACxH,sBAAsB;AACtB,wHAAwH;AAE3G,QAAA,uBAAuB,GAAG,cAAqC,OAAA,CAAC;IAC3E,IAAI,EAAE,iCAAyB;CAChC,CAAC,EAF0E,CAE1E,CAAA;AAEW,QAAA,4BAA4B,GAAG,UAAC,cAA8B,IAAyC,OAAA,CAAC;IACnH,IAAI,EAAE,sCAA8B;IACpC,OAAO,EAAE;QACP,cAAc,gBAAA;KACf;CACF,CAAC,EALkH,CA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QACL,YAAY,cAAA;QACZ,WAAW,aAAA;QACX,UAAU,YAAA;QACV,WAAW,aAAA;KACZ,CAAA;AACH,CAAC,CAAA;AAED,kBAAe,mCAAmC,CAAA"} \ No newline at end of file diff --git a/dist/reducers/index.js.map b/dist/reducers/index.js.map index 4247a07..9a66746 100644 --- a/dist/reducers/index.js.map +++ b/dist/reducers/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/reducers/index.ts"],"names":[],"mappings":";;AAAA,+BAAuC;AACvC,+CAAwC;AAExC,IAAM,qBAAqB,GAAG,uBAAe,CAAC;IAC5C,WAAW,wBAAA;CACZ,CAAC,CAAA;AAEF,kBAAe,qBAAqB,CAAA;AAEpC,wHAAwH;AACxH,4EAA4E;AAC5E,wHAAwH;AAExH,0CAA0C;AAC1C,2DAA2D;AAC3D,wDAAwD;AACxD,EAAE;AACF,wCAAwC;AACxC,2CAA2C;AAC3C,qBAAqB;AACrB,KAAK;AAEL,4EAA4E"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/reducers/index.ts"],"names":[],"mappings":";;AAAA,+BAGc;AACd,+CAAwC;AAExC,IAAM,qBAAqB,GAAgB,uBAAe,CAAC;IACzD,WAAW,wBAAA;CACZ,CAAC,CAAA;AAEF,kBAAe,qBAAqB,CAAA;AAEpC,wHAAwH;AACxH,4EAA4E;AAC5E,wHAAwH;AAExH,0CAA0C;AAC1C,2DAA2D;AAC3D,wDAAwD;AACxD,EAAE;AACF,wCAAwC;AACxC,2CAA2C;AAC3C,qBAAqB;AACrB,KAAK;AAEL,4EAA4E"} \ No newline at end of file diff --git a/dist/types.js b/dist/types.js index d4a71f8..a01faf8 100644 --- a/dist/types.js +++ b/dist/types.js @@ -1,5 +1,4 @@ "use strict"; -// Maybe make this the index.ts of a types directory so you can split things up Object.defineProperty(exports, "__esModule", { value: true }); exports.REGISTRATION_REQUEST_SENT = 'redux-token-auth/REGISTRATION_REQUEST_SENT'; exports.REGISTRATION_REQUEST_SUCCEEDED = 'redux-token-auth/REGISTRATION_REQUEST_SUCCEEDED'; diff --git a/dist/types.js.map b/dist/types.js.map index c68d539..ce5e017 100644 --- a/dist/types.js.map +++ b/dist/types.js.map @@ -1 +1 @@ -{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA,+EAA+E;;AAkClE,QAAA,yBAAyB,GAA8B,4CAA4C,CAAA;AAGnG,QAAA,8BAA8B,GAAmC,iDAAiD,CAAA;AAGlH,QAAA,2BAA2B,GAAgC,8CAA8C,CAAA;AAGzG,QAAA,yBAAyB,GAA8B,4CAA4C,CAAA;AAGnG,QAAA,8BAA8B,GAAmC,iDAAiD,CAAA;AAGlH,QAAA,2BAA2B,GAAgC,8CAA8C,CAAA;AAGzG,QAAA,mBAAmB,GAAwB,sCAAsC,CAAA;AAGjF,QAAA,wBAAwB,GAA6B,2CAA2C,CAAA;AAGhG,QAAA,qBAAqB,GAA0B,wCAAwC,CAAA;AAGvF,QAAA,oBAAoB,GAAyB,uCAAuC,CAAA;AAGpF,QAAA,yBAAyB,GAA8B,4CAA4C,CAAA;AAGnG,QAAA,sBAAsB,GAA2B,yCAAyC,CAAA"} \ No newline at end of file +{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;AAkCa,QAAA,yBAAyB,GAA8B,4CAA4C,CAAA;AAGnG,QAAA,8BAA8B,GAAmC,iDAAiD,CAAA;AAGlH,QAAA,2BAA2B,GAAgC,8CAA8C,CAAA;AAGzG,QAAA,yBAAyB,GAA8B,4CAA4C,CAAA;AAGnG,QAAA,8BAA8B,GAAmC,iDAAiD,CAAA;AAGlH,QAAA,2BAA2B,GAAgC,8CAA8C,CAAA;AAGzG,QAAA,mBAAmB,GAAwB,sCAAsC,CAAA;AAGjF,QAAA,wBAAwB,GAA6B,2CAA2C,CAAA;AAGhG,QAAA,qBAAqB,GAA0B,wCAAwC,CAAA;AAGvF,QAAA,oBAAoB,GAAyB,uCAAuC,CAAA;AAGpF,QAAA,yBAAyB,GAA8B,4CAA4C,CAAA;AAGnG,QAAA,sBAAsB,GAA2B,yCAAyC,CAAA"} \ No newline at end of file diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..c9dca27 --- /dev/null +++ b/index.d.ts @@ -0,0 +1,6 @@ +import { Reducer } from 'redux' +import { ActionsExport } from './src/types' + +export const reduxTokenAuthReducer: Reducer<{}> + +export const theActionsExportThatShouldBeRenamed: ActionsExport diff --git a/package-lock.json b/package-lock.json index 97751a0..e4134d8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "redux-token-auth", - "version": "0.1.0", + "version": "0.2.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index b1a58e0..d31aa4a 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,9 @@ { "name": "redux-token-auth", - "version": "0.2.0", + "version": "0.3.0", "description": "Redux actions and reducers to integrate with Devise Token Auth", "main": "dist/index.js", + "types": "index.d.ts", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "build": "tsc" diff --git a/src/actions.ts b/src/actions.ts index 56b691e..da48888 100644 --- a/src/actions.ts +++ b/src/actions.ts @@ -1,5 +1,4 @@ import axios from 'axios' -// import { authUrl } from '../../constants' // this has to be passed in by the package user import { Dispatch } from 'redux' import { AuthResponse, @@ -8,6 +7,7 @@ import { UserRegistrationDetails, UserSignInCredentials, UserSignOutCredentials, + ActionsExport, REGISTRATION_REQUEST_SENT, REGISTRATION_REQUEST_SUCCEEDED, REGISTRATION_REQUEST_FAILED, @@ -105,8 +105,7 @@ export const signOutRequestFailed = (): SignOutRequestFailedAction => ({ // Async Redux Thunk actions: //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Maybe type this even: -const theActionsExportThatShouldBeRenamed = (authUrl: string) => { +const theActionsExportThatShouldBeRenamed = (authUrl: string): ActionsExport => { const registerUser = ( userRegistrationDetails: UserRegistrationDetails, ) => async function (dispatch: Dispatch<{}>): Promise { diff --git a/src/reducers/index.ts b/src/reducers/index.ts index 7ac2a05..a3c225d 100644 --- a/src/reducers/index.ts +++ b/src/reducers/index.ts @@ -1,7 +1,10 @@ -import { combineReducers } from 'redux' +import { + combineReducers, + Reducer, +} from 'redux' import currentUser from './current-user' -const reduxTokenAuthReducer = combineReducers({ +const reduxTokenAuthReducer: Reducer<{}> = combineReducers({ currentUser, }) diff --git a/src/types.ts b/src/types.ts index 50e49e2..6a8252a 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,4 +1,4 @@ -// Maybe make this the index.ts of a types directory so you can split things up +import { Dispatch } from 'redux' // This one in particular will be a little tough because we don't know what the package user's "User" model looks like: export interface UserAttributes {} @@ -154,3 +154,12 @@ export type ReduxAction = RegistrationRequestSentAction | SignOutRequestSentAction | SignOutRequestSucceededAction | SignOutRequestFailedAction + +export type ReduxAsyncAction = (input: any) => (dispatch: Dispatch<{}>) => Promise + +export interface ActionsExport { + readonly registerUser: ReduxAsyncAction + readonly verifyToken: ReduxAsyncAction + readonly signInUser: ReduxAsyncAction + readonly signOutUser: ReduxAsyncAction +}