-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1155 from XYOracleNetwork/feature/image-thumbnail…
…-diviner-types Image Thumbnail Diviner Types
- Loading branch information
Showing
8 changed files
with
56 additions
and
40 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
packages/modules/packages/module/packages/model/src/Payload/ModuleState.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { isPayloadOfSchemaType, Payload } from '@xyo-network/payload-model' | ||
|
||
export interface StateDictionary { | ||
[key: string]: string | number | undefined | ||
} | ||
export interface State<T extends StateDictionary = StateDictionary> { | ||
state: T | ||
} | ||
|
||
export const ModuleStateSchema = 'network.xyo.module.state' as const | ||
export type ModuleStateSchema = typeof ModuleStateSchema | ||
|
||
export type ModuleState<T extends StateDictionary = StateDictionary> = Payload<State<T>, ModuleStateSchema> | ||
|
||
export const isModuleState = isPayloadOfSchemaType<ModuleState>(ModuleStateSchema) |
1 change: 1 addition & 0 deletions
1
packages/modules/packages/module/packages/model/src/Payload/index.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './ModuleState' |
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
2 changes: 1 addition & 1 deletion
2
...d/packages/image-thumbnail/src/Payload.ts → ...e-thumbnail/src/Payload/ImageThumbnail.ts
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
18 changes: 18 additions & 0 deletions
18
...ges/plugins/packages/payload/packages/image-thumbnail/src/Payload/ImageThumbnailResult.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { isPayloadOfSchemaType, Payload } from '@xyo-network/payload-model' | ||
|
||
import { ImageThumbnailSchema } from '../Schema' | ||
|
||
export const ImageThumbnailResultIndexSchema = `${ImageThumbnailSchema}.index` as const | ||
export type ImageThumbnailResultIndexSchema = typeof ImageThumbnailResultIndexSchema | ||
|
||
export interface ImageThumbnailResultInfo { | ||
sources: string[] | ||
// TODO: Something richer than HTTP status code that allows for info about failure modes | ||
status: number | ||
timestamp: number | ||
url: string | ||
} | ||
|
||
export type ImageThumbnailResult = Payload<ImageThumbnailResultInfo, ImageThumbnailResultIndexSchema> | ||
|
||
export const isImageThumbnailResult = isPayloadOfSchemaType<ImageThumbnailResult>(ImageThumbnailResultIndexSchema) |
2 changes: 2 additions & 0 deletions
2
packages/plugins/packages/payload/packages/image-thumbnail/src/Payload/index.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './ImageThumbnail' | ||
export * from './ImageThumbnailResult' |
2 changes: 1 addition & 1 deletion
2
packages/plugins/packages/payload/packages/image-thumbnail/src/Plugin.ts
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
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