@iiif/presentation-3
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -13,4 +13,4 @@ import { Reference } from '../reference'; | ||
items: T[]; | ||
annotations: Array<Reference<'Annotation'>>; | ||
annotations: Array<Reference<'AnnotationPage'>>; | ||
structures: Array<Reference<'Range'>>; | ||
}; |
{ | ||
"name": "@iiif/presentation-3", | ||
"description": "IIIF Presentation v3.0 typescript types", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"source": "index.js", | ||
@@ -25,4 +25,12 @@ "types": "index.d.ts", | ||
"devDependencies": { | ||
"tslib": "^2.0.0" | ||
"@typescript-eslint/eslint-plugin": "^5.9.1", | ||
"@typescript-eslint/parser": "^5.9.1", | ||
"eslint": "^8.7.0", | ||
"eslint-plugin-json": "^3.1.0", | ||
"eslint-plugin-prettier": "^4.0.0", | ||
"jest": "^27.4.7", | ||
"prettier": "^2.5.1", | ||
"typescript": "^4.5.5", | ||
"tslib": "^2.3.1" | ||
} | ||
} |
@@ -165,6 +165,6 @@ import { TechnicalProperties } from '../iiif/technical'; | ||
export declare type SvgSelector = | ||
| RefinedBy & { | ||
| (RefinedBy & { | ||
type: 'SvgSelector'; | ||
value: string; | ||
} | ||
}) | ||
| { | ||
@@ -181,2 +181,89 @@ type: 'SvgSelector'; | ||
// IIIF Extensions | ||
/** | ||
* The Image API Selector is used to describe the operations available via the Image API in order to retrieve a | ||
* particular image representation. In this case the resource is the abstract image as identified by the IIIF Image | ||
* API base URI plus identifier, and the retrieval process involves adding the correct parameters after that base URI. | ||
* For example, the top left hand quadrant of an image has the region parameter of pct:0,0,50,50 which must be put into | ||
* the requested URI to obtain the appropriate representation. | ||
* | ||
* In order to make this as easy as possible for the situations when a IIIF Image API endpoint exists, we introduce a | ||
* new Selector class called ImageApiSelector. It has properties that give the parameter values needed to fill out the | ||
* URL structure in the request. If the property is not given, then a default should be used. | ||
* | ||
* One use of this is within the IIIF Presentation API, when a Canvas is being painted by part of an image, or an image | ||
* that requires rotation before display. | ||
*/ | ||
type ImageApiSelector = { | ||
type: 'ImageApiSelector'; | ||
/** | ||
* The string to put in the region parameter of the URI. | ||
* Default: "full" | ||
*/ | ||
region?: string; | ||
/** | ||
* The string to put in the size parameter of the URI. | ||
* Default: "full" | ||
*/ | ||
size?: string; | ||
/** | ||
* The string to put in the rotation parameter of the URI. Note that this must be a string in order to allow | ||
* mirroring, for example “!90”. | ||
* Default: "0" | ||
*/ | ||
rotation?: string; | ||
/** | ||
* The string to put in the quality parameter of the URI. | ||
* Default: "default" | ||
*/ | ||
quality?: string; | ||
/** | ||
* The string to put in the format parameter of the URI. Note that the ‘.’ character is not part of the format, | ||
* just the URI syntax. | ||
* Default: "jpg" | ||
*/ | ||
format?: string; | ||
}; | ||
/** | ||
* There are common use cases in which a point, rather than a range or area, is the target of the Annotation. For | ||
* example, putting a pin in a map should result in an exact point, not a very small rectangle. Points in time are not | ||
* very short durations, and user interfaces should also treat these differently. This is particularly important when | ||
* zooming in (either spatially or temporally) beyond the scale of the frame of reference. Even if the point takes up a | ||
* 10 by 10 pixel square at the user’s current resolution, it is not a rectangle bounding an area. | ||
* | ||
* It is not possible to select a point using URI Fragments with the Media Fragment specification, as zero-sized | ||
* fragments are not allowed. In order to fulfill the use cases, this specification defines a new Selector class | ||
* called PointSelector. | ||
*/ | ||
export type PointSelector = { | ||
type: 'PointSelector'; | ||
/** | ||
* Optional. An integer giving the x coordinate of the point, relative to the dimensions of the target resource. | ||
*/ | ||
x?: number; | ||
/** | ||
* Optional. An integer giving the y coordinate of the point, relative to the dimensions of the target resource. | ||
*/ | ||
y?: number; | ||
/** | ||
* Optional. A floating point number giving the time of the point in seconds, relative to the duration of the target | ||
* resource. | ||
*/ | ||
t?: number; | ||
}; | ||
export type AudioContentSelector = { | ||
type: 'AudioContentSelector'; | ||
}; | ||
export type VisualContentSelector = { | ||
type: 'VisualContentSelector'; | ||
}; | ||
export declare type Selector = | ||
@@ -191,2 +278,6 @@ | string | ||
| SvgSelector | ||
| ImageApiSelector | ||
| PointSelector | ||
| AudioContentSelector | ||
| VisualContentSelector | ||
| RangeSelector<FragmentSelector> | ||
@@ -198,3 +289,4 @@ | RangeSelector<CssSelector> | ||
| RangeSelector<DataPositionSelector> | ||
| RangeSelector<SvgSelector>; | ||
| RangeSelector<SvgSelector> | ||
| RangeSelector<PointSelector>; | ||
@@ -220,8 +312,8 @@ export declare type State = BasicState | TimeState | RequestHeaderState; | ||
export declare type TimeState = | ||
| RefinedByState & { | ||
| (RefinedByState & { | ||
type: 'TimeState'; | ||
sourceDate: string | string[]; | ||
cached?: string | string[]; | ||
} | ||
| RefinedByState & { | ||
}) | ||
| (RefinedByState & { | ||
type: 'TimeState'; | ||
@@ -231,3 +323,3 @@ sourceDateStart: string; | ||
cached?: string | string[]; | ||
}; | ||
}); | ||
@@ -234,0 +326,0 @@ export declare type RequestHeaderState = RefinedByState & { |
@@ -60,2 +60,4 @@ import { AnnotationCollection, W3CAnnotationCollection } from './annotationCollection'; | ||
> & | ||
OmitProperties<LinkingNormalized, AnnotationPageOmittedLinking> & { type: 'AnnotationPage' }; | ||
OmitProperties<LinkingNormalized, AnnotationPageOmittedLinking> & { | ||
type: 'AnnotationPage'; | ||
}; |
@@ -36,2 +36,4 @@ import { TechnicalProperties } from '../iiif/technical'; | ||
> & | ||
OmitProperties<LinkingNormalized, CollectionOmittedLinking> & { type: 'Collection' }; | ||
OmitProperties<LinkingNormalized, CollectionOmittedLinking> & { | ||
type: 'Collection'; | ||
}; |
@@ -32,2 +32,4 @@ import { TechnicalProperties } from '../iiif/technical'; | ||
StructuralNormalized<Reference<ManifestItemSchemas>, ManifestItemSchemas> & | ||
OmitProperties<LinkingNormalized, ManifestOmittedLinking> & { type: 'Manifest' }; | ||
OmitProperties<LinkingNormalized, ManifestOmittedLinking> & { | ||
type: 'Manifest'; | ||
}; |
@@ -10,3 +10,4 @@ export declare type GeoJsonService = { | ||
id: string; | ||
}) & | ||
} | ||
) & | ||
Partial<import('geojson').GeoJSON>; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
81375
1360
9