Skip to content

Commit

Permalink
chore(gatsby): Migrate redux/actions/types and redux/actions/restrict…
Browse files Browse the repository at this point in the history
…ed to TypeScript (#22297)

* chore: restricted.js to TypeScript

* fix: require to import statement

* chore: enhance payload types

Co-authored-by: Blaine Kasten <blainekasten@gmail.com>
  • Loading branch information
1natsu172 and blainekasten authored Apr 10, 2020
1 parent 90afde3 commit 1272037
Show file tree
Hide file tree
Showing 5 changed files with 594 additions and 482 deletions.
17 changes: 9 additions & 8 deletions packages/gatsby/src/redux/actions/internal.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
IGatsbyPlugin,
ProgramStatus,
ICreatePageDependencyAction,
IDeleteComponentDependenciesAction,
Expand Down Expand Up @@ -81,7 +82,7 @@ export const replaceComponentQuery = ({
*/
export const replaceStaticQuery = (
args: any,
plugin: Plugin | null | undefined = null
plugin: IGatsbyPlugin | null | undefined = null
): IReplaceStaticQueryAction => {
return {
type: `REPLACE_STATIC_QUERY`,
Expand All @@ -98,7 +99,7 @@ export const replaceStaticQuery = (
*/
export const queryExtracted = (
{ componentPath, query }: { componentPath: string; query: string },
plugin: Plugin,
plugin: IGatsbyPlugin,
traceId?: string
): IQueryExtractedAction => {
return {
Expand All @@ -116,7 +117,7 @@ export const queryExtracted = (
*/
export const queryExtractionGraphQLError = (
{ componentPath, error }: { componentPath: string; error: string },
plugin: Plugin,
plugin: IGatsbyPlugin,
traceId?: string
): IQueryExtractionGraphQLErrorAction => {
return {
Expand All @@ -135,7 +136,7 @@ export const queryExtractionGraphQLError = (
*/
export const queryExtractedBabelSuccess = (
{ componentPath },
plugin: Plugin,
plugin: IGatsbyPlugin,
traceId?: string
): IQueryExtractedBabelSuccessAction => {
return {
Expand All @@ -153,7 +154,7 @@ export const queryExtractedBabelSuccess = (
*/
export const queryExtractionBabelError = (
{ componentPath, error }: { componentPath: string; error: Error },
plugin: Plugin,
plugin: IGatsbyPlugin,
traceId?: string
): IQueryExtractionBabelErrorAction => {
return {
Expand All @@ -170,7 +171,7 @@ export const queryExtractionBabelError = (
*/
export const setProgramStatus = (
status: ProgramStatus,
plugin: Plugin,
plugin: IGatsbyPlugin,
traceId?: string
): ISetProgramStatusAction => {
return {
Expand All @@ -187,7 +188,7 @@ export const setProgramStatus = (
*/
export const pageQueryRun = (
{ path, componentPath, isPage },
plugin: Plugin,
plugin: IGatsbyPlugin,
traceId?: string
): IPageQueryRunAction => {
return {
Expand All @@ -204,7 +205,7 @@ export const pageQueryRun = (
*/
export const removeStaleJob = (
contentDigest: string,
plugin: Plugin,
plugin: IGatsbyPlugin,
traceId?: string
): IRemoveStaleJobAction => {
return {
Expand Down
Loading

0 comments on commit 1272037

Please sign in to comment.