Package Exports
- functional-types
- functional-types/lib/FileType
- functional-types/lib/Folder
- functional-types/lib/TableAnnotation
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (functional-types) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
functional-types
Index
Modules
functional-types
Interfaces
functional-types › "Folder" › Attributes
Interface: Attributes
Hierarchy
- Attributes
Index
Properties
Properties
folder
• folder: string
Defined in Folder.ts:29
id
• id: string
Defined in Folder.ts:28
name
• name: string
Defined in Folder.ts:30
type
• type: FT.FileType
Defined in Folder.ts:31
functional-types › "Folder" › Folder
Interface: Folder
Hierarchy
- Folder
Index
Properties
Properties
created_at
• created_at: string
Defined in Folder.ts:23
id
• id: string
Defined in Folder.ts:21
name
• name: string
Defined in Folder.ts:22
updated_at
• updated_at: string
Defined in Folder.ts:24
functional-types › "Folder" › Metadata
Interface: Metadata
Hierarchy
- Metadata
Index
Properties
Properties
bucket
• bucket: string
Defined in Folder.ts:40
content_type
• content_type: string
Defined in Folder.ts:42
created_at
• created_at: string
Defined in Folder.ts:44
generation
• generation: string
Defined in Folder.ts:41
id
• id: string
Defined in Folder.ts:36
kind
• kind: string
Defined in Folder.ts:35
media_link
• media_link: string
Defined in Folder.ts:38
name
• name: string
Defined in Folder.ts:39
self_link
• self_link: string
Defined in Folder.ts:37
size
• size: string
Defined in Folder.ts:43
updated_at
• updated_at: string
Defined in Folder.ts:45
functional-types › "Label" › Label
Interface: Label
Hierarchy
- Label
Index
Properties
Properties
color
• color: string
Defined in Label.ts:6
id
• id: string
Defined in Label.ts:4
name
• name: string
Defined in Label.ts:5
functional-types › "TableAnnotation" › TableAnnotation
Interface: TableAnnotation
Hierarchy
- TableAnnotation
Index
Properties
Properties
boundingBoxesByPageId
• boundingBoxesByPageId: BoundingBoxByPageId
Defined in TableAnnotation.ts:11
created_at
• created_at: string
Defined in TableAnnotation.ts:12
file
• file: string
Defined in TableAnnotation.ts:10
id
• id: string
Defined in TableAnnotation.ts:9
updated_at
• updated_at: string
Defined in TableAnnotation.ts:13
functional-types › "Vertex" › BoundingBox
Interface: BoundingBox
Hierarchy
BoundingBox
Index
Properties
Properties
boundingPoly
• boundingPoly: Poly
Defined in Vertex.ts:30
columns
• columns: Line[]
Defined in Vertex.ts:32
rows
• rows: Line[]
Defined in Vertex.ts:31
functional-types › "Vertex" › LabeledBoundingBox
Interface: LabeledBoundingBox
Hierarchy
-
↳ LabeledBoundingBox
Index
Properties
Properties
boundingPoly
• boundingPoly: Poly
Inherited from BoundingBox.boundingPoly
Defined in Vertex.ts:30
columns
• columns: Line[]
Inherited from BoundingBox.columns
Defined in Vertex.ts:32
id
• id: string
Defined in Vertex.ts:44
label
• label: string
Defined in Vertex.ts:45
rows
• rows: Line[]
Inherited from BoundingBox.rows
Defined in Vertex.ts:31
functional-types › "Vertex" › Vertex
Interface: Vertex
Hierarchy
- Vertex
Index
Properties
Properties
x
• x: number
Defined in Vertex.ts:21
y
• y: number
Defined in Vertex.ts:22
Modules
functional-types › "Arbitraries"
Module: "Arbitraries"
Index
Functions
Functions
Const file
▸ file(): Arbitrary‹File›
Defined in Arbitraries.ts:55
Returns: Arbitrary‹File›
Const filesByType
▸ filesByType(): Arbitrary‹FilesByType›
Defined in Arbitraries.ts:65
Returns: Arbitrary‹FilesByType›
Const folder
▸ folder(): Arbitrary‹Folder›
Defined in Arbitraries.ts:37
Returns: Arbitrary‹Folder›
Const invalidFolderObject
▸ invalidFolderObject(): Arbitrary‹Record‹string, any››
Defined in Arbitraries.ts:5
Returns: Arbitrary‹Record‹string, any››
Const metadata
▸ metadata(): Arbitrary‹Metadata›
Defined in Arbitraries.ts:40
Returns: Arbitrary‹Metadata›
Const nonFolderObject
▸ nonFolderObject(): Arbitrary‹unknown›
Defined in Arbitraries.ts:20
Returns: Arbitrary‹unknown›
Module: "DateTime"
Index
Variables
Functions
Variables
Const getCurrentUnixTimestamp
• getCurrentUnixTimestamp: function = Date.now
Defined in DateTime.ts:14
getCurrentUnixTimestamp :: () -> IntType declaration:
▸ (): number
Functions
Const getCurrentDate
▸ getCurrentDate(): Date
Defined in DateTime.ts:16
Returns: Date
Const getUnixTimestamp
▸ getUnixTimestamp(date: Date): number
Defined in DateTime.ts:6
getUnixTimestamp :: Date -> IntParameters:
| Name | Type |
|---|---|
date |
Date |
Returns: number
Module: "FileType"
Index
Type aliases
Variables
- contentTypes
- documentTypes
- fileContentTypes
- fileTypes
- fromContentType
- fromDocumentContentType
- fromImageContentType
- imageContentTypes
- imageTypes
- toContentType
- toDocumentContentType
- toImageContentType
Functions
Type aliases
ContentType
Ƭ ContentType: DocumentContentType | ImageContentType
Defined in FileType.ts:26
DocumentContentType
Ƭ DocumentContentType: "application/pdf" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "application/json"
Defined in FileType.ts:19
DocumentType
Ƭ DocumentType: "pdf" | "excel" | "json"
Defined in FileType.ts:13
FileType
Ƭ FileType: DocumentType | ImageType
Defined in FileType.ts:17
ImageContentType
Ƭ ImageContentType: "image/png" | "image/jpeg"
Defined in FileType.ts:24
ImageType
Ƭ ImageType: "png" | "jpeg"
Defined in FileType.ts:15
Variables
Const contentTypes
• contentTypes: ContentType[] = values(FileTypeToContentType)
Defined in FileType.ts:151
contentTypes: [ContentType]Const documentTypes
• documentTypes: DocumentType[] = keys(DocumentTypeToContentType)
Defined in FileType.ts:112
documentTypes: [DocumentType]Const fileContentTypes
• fileContentTypes: DocumentContentType[] = values( DocumentTypeToContentType )
Defined in FileType.ts:133
contentTypes: [DocumentContentType]Const fileTypes
• fileTypes: FileType[] = keys(FileTypeToContentType)
Defined in FileType.ts:126
fileTypes: [FileType]Const fromContentType
• fromContentType: function = prop( __, ContentTypeToFileType )
Defined in FileType.ts:252
fromContentType :: ContentType -> FileTypeType declaration:
▸ (contentType: ContentType): FileType
Parameters:
| Name | Type |
|---|---|
contentType |
ContentType |
Const fromDocumentContentType
• fromDocumentContentType: function = prop(__, ContentTypeToDocumentType)
Defined in FileType.ts:234
fromDocumentContentType :: DocumentContentType -> DocumentTypeType declaration:
▸ (contentType: DocumentContentType): DocumentType
Parameters:
| Name | Type |
|---|---|
contentType |
DocumentContentType |
Const fromImageContentType
• fromImageContentType: function = prop(__, ContentTypeToImageType)
Defined in FileType.ts:243
fromImageContentType :: DocumentContentType -> DocumentTypeType declaration:
▸ (contentType: ImageContentType): ImageType
Parameters:
| Name | Type |
|---|---|
contentType |
ImageContentType |
Const imageContentTypes
• imageContentTypes: ImageContentType[] = values( ImageTypeToContentType )
Defined in FileType.ts:142
imageContentTypes: [DocumentContentType]Const imageTypes
• imageTypes: ImageType[] = keys(ImageTypeToContentType)
Defined in FileType.ts:119
imageTypes: [DocumentType]Const toContentType
• toContentType: function = prop( __, FileTypeToContentType )
Defined in FileType.ts:224
toContentType :: FileType -> ContentTypeType declaration:
▸ (fileType: FileType): ContentType
Parameters:
| Name | Type |
|---|---|
fileType |
FileType |
Const toDocumentContentType
• toDocumentContentType: function = prop(__, DocumentTypeToContentType)
Defined in FileType.ts:206
toDocumentContentType :: DocumentType -> DocumentContentTypeType declaration:
▸ (fileType: DocumentType): DocumentContentType
Parameters:
| Name | Type |
|---|---|
fileType |
DocumentType |
Const toImageContentType
• toImageContentType: function = prop(__, ImageTypeToContentType)
Defined in FileType.ts:215
toImageContentType :: DocumentType -> ImageContentTypeType declaration:
▸ (imageType: ImageType): ImageContentType
Parameters:
| Name | Type |
|---|---|
imageType |
ImageType |
Functions
Const isContentType
▸ isContentType(a: unknown): a is ContentType
Defined in FileType.ts:198
isContentType :: a -> boolParameters:
| Name | Type |
|---|---|
a |
unknown |
Returns: a is ContentType
Const isDocumentContentType
▸ isDocumentContentType(a: unknown): a is DocumentContentType
Defined in FileType.ts:182
isDocumentContentType :: a -> boolParameters:
| Name | Type |
|---|---|
a |
unknown |
Returns: a is DocumentContentType
Const isDocumentType
▸ isDocumentType(a: unknown): a is DocumentType
Defined in FileType.ts:158
isDocumentType :: a -> boolParameters:
| Name | Type |
|---|---|
a |
unknown |
Returns: a is DocumentType
Const isFileType
▸ isFileType(a: unknown): a is ImageType
Defined in FileType.ts:174
isFileType :: a -> boolParameters:
| Name | Type |
|---|---|
a |
unknown |
Returns: a is ImageType
Const isImageContentType
▸ isImageContentType(a: unknown): a is ImageContentType
Defined in FileType.ts:190
isDocumentContentType :: a -> boolParameters:
| Name | Type |
|---|---|
a |
unknown |
Returns: a is ImageContentType
Const isImageType
▸ isImageType(a: unknown): a is ImageType
Defined in FileType.ts:166
isImageType :: a -> boolParameters:
| Name | Type |
|---|---|
a |
unknown |
Returns: a is ImageType
Module: "Folder"
Index
Interfaces
Type aliases
Variables
Functions
Type aliases
File
Ƭ File: Attributes & object
Defined in Folder.ts:48
FilesByType
Ƭ FilesByType: Record‹FT.DocumentType, File[]›
Defined in Folder.ts:50
Variables
Const getAttributesFromName
• getAttributesFromName: function = pipe( split('/'), E.fromPredicate( (segments: string[]) => segments.length >= 2, () => new Error('Invalid file name format.') ), E.map(([folder, ...names]: string[]) => { const name = names.join('/'); return { id: join('/')([folder, name]), folder, name, }; }) )
Defined in Folder.ts:157
getAttributesFromName :: String -> Either Attributes ErrorType declaration:
▸ (name: string): E.Either‹Error, Omit‹Attributes, "type"››
Parameters:
| Name | Type |
|---|---|
name |
string |
Functions
Const fromMetadata
▸ fromMetadata(metadata: Metadata): Left‹Error› | Right‹object›
Defined in Folder.ts:180
fromMetadata :: Metadata -> EitherParameters:
| Name | Type |
|---|---|
metadata |
Metadata |
Returns: Left‹Error› | Right‹object›
Const isFile
▸ isFile(a: unknown): a is File
Defined in Folder.ts:130
isFile :: a -> boolParameters:
| Name | Type |
|---|---|
a |
unknown |
Returns: a is File
Const isFileArray
▸ isFileArray(a: unknown): a is File[]
Defined in Folder.ts:138
isFileArray :: a -> boolParameters:
| Name | Type |
|---|---|
a |
unknown |
Returns: a is File[]
Const isFilesByType
▸ isFilesByType(a: unknown): a is FilesByType
Defined in Folder.ts:146
isFilesByType :: a -> boolParameters:
| Name | Type |
|---|---|
a |
unknown |
Returns: a is FilesByType
Const isFolder
▸ isFolder(a: unknown): a is Folder
Defined in Folder.ts:57
isFolder -> boolParameters:
| Name | Type |
|---|---|
a |
unknown |
Returns: a is Folder
Const isMetadata
▸ isMetadata(a: unknown): a is Metadata
Defined in Folder.ts:107
isMetadata :: a -> boolParameters:
| Name | Type |
|---|---|
a |
unknown |
Returns: a is Metadata
Const make
▸ make(name: string): (Anonymous function)
Defined in Folder.ts:71
make :: String -> FolderParameters:
| Name | Type |
|---|---|
name |
string |
Returns: (Anonymous function)
Module: "index"
Index
References
References
F
• F:
FT
• FT:
L
• L:
T
• T:
V
• V:
Module: "Label"
Index
Interfaces
Type aliases
Variables
Functions
Type aliases
ColorMappings
Ƭ ColorMappings: Record‹string, string›
Defined in Label.ts:9
Variables
Const toColorMappings
• toColorMappings: function = reduce( (acc: ColorMappings, label: Label) => assoc(label.id, label.color)(acc), {} )
Defined in Label.ts:29
toColorMappings :: [Label] -> ColorMappingsType declaration:
▸ (labels: Label[]): ColorMappings
Parameters:
| Name | Type |
|---|---|
labels |
Label[] |
Functions
Const isLabel
▸ isLabel(a: unknown): a is Label
Defined in Label.ts:16
isLabel :: a -> boolParameters:
| Name | Type |
|---|---|
a |
unknown |
Returns: a is Label
Module: "String"
Index
Variables
Variables
Const getRandomId
• getRandomId: IO‹string› = uuid
Defined in String.ts:9
getRandomId: IO String
functional-types › "TableAnnotation"
Module: "TableAnnotation"
Index
Interfaces
Type aliases
Functions
Type aliases
BoundingBoxByPageId
Ƭ BoundingBoxByPageId: Record‹string, LabeledBoundingBox[]›
Defined in TableAnnotation.ts:6
TableAnnotationBase
Ƭ TableAnnotationBase: Pick‹TableAnnotation, "file" | "boundingBoxesByPageId"›
Defined in TableAnnotation.ts:16
Functions
Const isBoundingBoxByPageId
▸ isBoundingBoxByPageId(a: unknown): a is BoundingBoxByPageId
Defined in TableAnnotation.ts:26
isBoundingBoxByPageId :: a -> boolParameters:
| Name | Type |
|---|---|
a |
unknown |
Returns: a is BoundingBoxByPageId
Const isTableAnnotation
▸ isTableAnnotation(a: unknown): a is TableAnnotation
Defined in TableAnnotation.ts:48
isTableAnnotation :: a -> boolParameters:
| Name | Type |
|---|---|
a |
unknown |
Returns: a is TableAnnotation
Const isTableAnnotationBase
▸ isTableAnnotationBase(a: unknown): a is TableAnnotationBase
Defined in TableAnnotation.ts:36
isTableAnnotationBase :: a -> boolParameters:
| Name | Type |
|---|---|
a |
unknown |
Returns: a is TableAnnotationBase
Const make
▸ make(__namedParameters: object): (Anonymous function)
Defined in TableAnnotation.ts:63
make :: (String, BoundingBoxByPageId) -> IO TableAnnotationParameters:
▪ __namedParameters: object
| Name | Type |
|---|---|
boundingBoxesByPageId |
object |
file |
string |
Returns: (Anonymous function)
Module: "Vertex"
Index
Interfaces
Type aliases
Variables
Functions
- append
- hasHeaderColumn
- hasHeaderRow
- isBoundingBox
- isLabeledBoundingBox
- isLine
- isPoly
- isVertex
- makeBoundingBox
- makeLabeledBoundingBox
- makeLine
- makePoly
- makeVertex
Type aliases
Line
Defined in Vertex.ts:25
Poly
Ƭ Poly: [Vertex, Vertex, Vertex, Vertex]
Defined in Vertex.ts:27
WithHeaderColumn
Ƭ WithHeaderColumn: A & object
Defined in Vertex.ts:39
WithHeaderRow
Ƭ WithHeaderRow: A & object
Defined in Vertex.ts:35
Variables
Const getX
• getX: function = pipe(head, prop<'x', number>('x'))
Defined in Vertex.ts:261
getX :: Line -> IntType declaration:
▸ (line: Line): number
Parameters:
| Name | Type |
|---|---|
line |
Line |
Const getXs
• getXs: function = map(getX)
Defined in Vertex.ts:275
getXs :: [Line] -> [Int]Type declaration:
▸ (lines: Line[]): number[]
Parameters:
| Name | Type |
|---|---|
lines |
Line[] |
Const getY
• getY: function = pipe(head, prop<'y', number>('y'))
Defined in Vertex.ts:254
getY :: Line -> IntType declaration:
▸ (line: Line): number
Parameters:
| Name | Type |
|---|---|
line |
Line |
Const getYs
• getYs: function = map(getY)
Defined in Vertex.ts:268
getYs :: [Line] -> [Int]Type declaration:
▸ (lines: Line[]): number[]
Parameters:
| Name | Type |
|---|---|
lines |
Line[] |
Functions
Const append
▸ append<**A**>(boundingBox: A): (Anonymous function)
Defined in Vertex.ts:313
append :: ([Int], [Int]) -> BoundingBoxType parameters:
▪ A: BoundingBox
Parameters:
| Name | Type |
|---|---|
boundingBox |
A |
Returns: (Anonymous function)
Const hasHeaderColumn
▸ hasHeaderColumn<**A**>(a: A): a is WithHeaderRow
Defined in Vertex.ts:110
hasHeaderColumn :: a -> boolType parameters:
▪ A: BoundingBox
Parameters:
| Name | Type |
|---|---|
a |
A |
Const hasHeaderRow
▸ hasHeaderRow<**A**>(a: A): a is WithHeaderRow
Defined in Vertex.ts:102
hasHeaderRow :: a -> boolType parameters:
▪ A: BoundingBox
Parameters:
| Name | Type |
|---|---|
a |
A |
Const isBoundingBox
▸ isBoundingBox(a: unknown): a is BoundingBox
Defined in Vertex.ts:90
isBoundingBox :: a -> boolParameters:
| Name | Type |
|---|---|
a |
unknown |
Returns: a is BoundingBox
Const isLabeledBoundingBox
▸ isLabeledBoundingBox(a: unknown): a is LabeledBoundingBox
Defined in Vertex.ts:282
isLabeledBoundingBox :: a -> boolParameters:
| Name | Type |
|---|---|
a |
unknown |
Returns: a is LabeledBoundingBox
Const isLine
▸ isLine(a: unknown): a is Line
Defined in Vertex.ts:66
isLine :: a -> boolParameters:
| Name | Type |
|---|---|
a |
unknown |
Returns: a is Line
Const isPoly
▸ isPoly(a: unknown): a is Poly
Defined in Vertex.ts:74
isPoly :: a -> boolParameters:
| Name | Type |
|---|---|
a |
unknown |
Returns: a is Poly
Const isVertex
▸ isVertex(a: unknown): a is Vertex
Defined in Vertex.ts:58
isVertex :: a -> boolParameters:
| Name | Type |
|---|---|
a |
unknown |
Returns: a is Vertex
Const makeBoundingBox
▸ makeBoundingBox(boundingPoly: Poly, ys: number[], xs: number[]): BoundingBox
Defined in Vertex.ts:235
makeBoundingBox :: (Poly, [Int], [Int]) -> BoundingBoxParameters:
| Name | Type |
|---|---|
boundingPoly |
Poly |
ys |
number[] |
xs |
number[] |
Returns: BoundingBox
Const makeLabeledBoundingBox
▸ makeLabeledBoundingBox(id: string, label: string, boundingPoly: Poly, ys: number[], xs: number[]): LabeledBoundingBox
Defined in Vertex.ts:290
makeLabeledBoundingBox :: (String, String, Poly, [Int], [Int]) -> LabeledBoundingBoxParameters:
| Name | Type |
|---|---|
id |
string |
label |
string |
boundingPoly |
Poly |
ys |
number[] |
xs |
number[] |
Returns: LabeledBoundingBox
Const makeLine
▸ makeLine(x0: number, y0: number, x1: number, y1: number): Line
Defined in Vertex.ts:126
makeVertex :: (Int, Int, Int, Int) -> LineParameters:
| Name | Type |
|---|---|
x0 |
number |
y0 |
number |
x1 |
number |
y1 |
number |
Returns: Line
Const makePoly
▸ makePoly(...coords: [number, number, number, number]): Poly
Defined in Vertex.ts:191
makePoly :: (Int, Int, Int, Int) -> PolyParameters:
| Name | Type |
|---|---|
...coords |
[number, number, number, number] |
Returns: Poly
Const makeVertex
▸ makeVertex(x: number, y: number): Vertex
Defined in Vertex.ts:119
makeVertex :: (Int, Int) -> VertexParameters:
| Name | Type |
|---|---|
x |
number |
y |
number |
Returns: Vertex