Variable DocmapConst

Docmap: IntersectionC<[TypeC<{
    @context: LiteralC<"https://w3id.org/docmaps/context.jsonld">;
    created: DateFromUnknownC;
    id: StringC;
    publisher: IntersectionC<[TypeC<{}>, PartialC<{
        account: IntersectionC<[TypeC<{
            id: StringC;
        }>, PartialC<{
            service: UrlFromStringC;
        }>]>;
        homepage: UrlFromStringC;
        id: StringC;
        logo: UrlFromStringC;
        name: StringC;
        url: UrlFromStringC;
    }>]>;
    type: UnionC<[LiteralC<string>, ArrayC<LiteralC<string>>]> | UnionC<[ArrayC<UnionC<[LiteralC<string>, LiteralC<string>, ...LiteralC<string>[]]>>, UnionC<[LiteralC<string>, LiteralC<string>, ...LiteralC<string>[]]>]>;
}>, PartialC<{
    first-step: StringC;
    steps: RecordC<StringC, IntersectionC<[TypeC<{
        actions: ArrayC<IntersectionC<[TypeC<{
            inputs: ArrayC<IntersectionC<[TypeC<{}>, PartialC<{
                content: ArrayC<IntersectionC<[TypeC<{
                    type: UnionC<[LiteralC<string>, ArrayC<LiteralC<string>>]> | UnionC<[ArrayC<UnionC<[LiteralC<string>, LiteralC<string>, ...LiteralC<string>[]]>>, UnionC<[LiteralC<string>, LiteralC<string>, ...LiteralC<string>[]]>]>;
                }>, PartialC<{
                    id: StringC;
                    service: UrlFromStringC;
                    url: UrlFromStringC;
                }>]>>;
                doi: StringC;
                id: StringC;
                published: DateFromUnknownC;
                type: UnionC<[LiteralC<string>, ArrayC<LiteralC<string>>]> | UnionC<[ArrayC<UnionC<[LiteralC<string>, LiteralC<string>, ...LiteralC<string>[]]>>, UnionC<[LiteralC<string>, LiteralC<string>, ...LiteralC<string>[]]>]>;
                url: UrlFromStringC;
            }>]>>;
            outputs: ArrayC<IntersectionC<[TypeC<{}>, PartialC<{
                content: ArrayC<IntersectionC<[TypeC<{
                    type: UnionC<[LiteralC<string>, ArrayC<LiteralC<string>>]> | UnionC<[ArrayC<UnionC<[LiteralC<string>, LiteralC<string>, ...LiteralC<string>[]]>>, UnionC<[LiteralC<string>, LiteralC<string>, ...LiteralC<string>[]]>]>;
                }>, PartialC<{
                    id: StringC;
                    service: UrlFromStringC;
                    url: UrlFromStringC;
                }>]>>;
                doi: StringC;
                id: StringC;
                published: DateFromUnknownC;
                type: UnionC<[LiteralC<string>, ArrayC<LiteralC<string>>]> | UnionC<[ArrayC<UnionC<[LiteralC<string>, LiteralC<string>, ...LiteralC<string>[]]>>, UnionC<[LiteralC<string>, LiteralC<string>, ...LiteralC<string>[]]>]>;
                url: UrlFromStringC;
            }>]>>;
            participants: ArrayC<IntersectionC<[TypeC<{
                actor: UnionC<[TypeC<{
                    name: StringC;
                    type: UnionC<[LiteralC<string>, ArrayC<LiteralC<string>>]> | UnionC<[ArrayC<UnionC<[LiteralC<string>, LiteralC<string>, ...LiteralC<string>[]]>>, UnionC<[LiteralC<string>, LiteralC<string>, ...LiteralC<string>[]]>]>;
                }>, UnknownC]>;
                role: StringC;
            }>, PartialC<{
                id: StringC;
                type: UnionC<[LiteralC<"pro:roleintime">, LiteralC<"pro:RoleInTime">]>;
            }>]>>;
        }>, PartialC<{
            id: StringC;
        }>]>>;
        assertions: ArrayC<IntersectionC<[TypeC<{
            item: UnknownC;
            status: StringC;
        }>, PartialC<{
            happened: DateFromUnknownC;
        }>]>>;
    }>, PartialC<{
        id: StringC;
        inputs: ArrayC<IntersectionC<[TypeC<{}>, PartialC<{
            content: ArrayC<IntersectionC<[TypeC<{
                type: UnionC<[LiteralC<string>, ArrayC<LiteralC<string>>]> | UnionC<[ArrayC<UnionC<[LiteralC<string>, LiteralC<string>, ...LiteralC<string>[]]>>, UnionC<[LiteralC<string>, LiteralC<string>, ...LiteralC<string>[]]>]>;
            }>, PartialC<{
                id: StringC;
                service: UrlFromStringC;
                url: UrlFromStringC;
            }>]>>;
            doi: StringC;
            id: StringC;
            published: DateFromUnknownC;
            type: UnionC<[LiteralC<string>, ArrayC<LiteralC<string>>]> | UnionC<[ArrayC<UnionC<[LiteralC<string>, LiteralC<string>, ...LiteralC<string>[]]>>, UnionC<[LiteralC<string>, LiteralC<string>, ...LiteralC<string>[]]>]>;
            url: UrlFromStringC;
        }>]>>;
        next-step: UnionC<[StringC, NullC]>;
        previous-step: UnionC<[StringC, NullC]>;
    }>]>>;
    updated: DateFromUnknownC;
}>]> = ...

Example

import { DocmapT, Docmap } from '@docmaps/sdk';
import { Validation } from 'io-ts';

const C: Validation<DocmapT> = Docmap.decode({
context: [{
type: 'schema',
value: 'https://schema.org/'
}],
id: '123456',
type: 'Docmap',
publisher: {
type: 'person',
name: 'John Doe'
},
created: '2020-01-01',
steps: {
'step-1': {
actions: [{
outputs: [{
published: '2020-01-01',
id: '123456',
doi: '10.12345/abcdef',
type: 'Article',
content: [{
type: 'text',
text: 'This is an example of a thing'
}]
}],
participants: [{
actor: {
type: 'person',
name: 'John Doe'
},
role: 'author'
}],
id: '123456'
}],
inputs: [{
published: '2020-01-01',
id: '123456',
doi: '10.12345/abcdef',
type: 'Article',
content: [{
type: 'text',
text: 'This is an example of a thing'
}]
}],
assertions: [{
item: {
type: 'Article',
id: '123456'
},
status: 'accepted',
happened: '2020-01-01'
}],
id: '123456',
'next-step': 'step-2',
},
'step-2': {
//...
}
},
'first-step': 'step-1',
updated: '2020-01-01'
});

Since

0.1.0

TODO: use smart validation rules for custom io-ts docmap type, such as next-steps referring to steps that exist and any other value-dependent type rules. see https://github.com/Docmaps-Project/docmaps/issues/23

TODO: support something where docmaps: is prefixed t.literal('docmaps:docmap'), t.literal('docmaps:Docmap'), or abbreviate the Base somehow on the w3id docmap repo.

Generated using TypeDoc