mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-16 23:10:29 +00:00
composer-concerto: Provides its own types (#39636)
This commit is contained in:
committed by
Nathan Shively-Sanders
parent
9b4602025b
commit
854af1adc3
@@ -546,6 +546,12 @@
|
||||
"sourceRepoURL": "https://github.com/tj/commander.js",
|
||||
"asOfVersion": "2.12.2"
|
||||
},
|
||||
{
|
||||
"libraryName": "composer-concerto",
|
||||
"typingsPackageName": "composer-concerto",
|
||||
"sourceRepoURL": "https://github.com/hyperledger/composer-concerto#readme",
|
||||
"asOfVersion": "0.71.1"
|
||||
},
|
||||
{
|
||||
"libraryName": "compare-versions",
|
||||
"typingsPackageName": "compare-versions",
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
import { ModelManager, Factory, Serializer } from 'composer-concerto';
|
||||
|
||||
const modelManager = new ModelManager();
|
||||
modelManager.addModelFile(
|
||||
`namespace org.acme.address
|
||||
/**
|
||||
* This is a concept
|
||||
*/
|
||||
concept PostalAddress {
|
||||
o String streetAddress optional
|
||||
o String postalCode optional
|
||||
o String postOfficeBoxNumber optional
|
||||
o String addressRegion optional
|
||||
o String addressLocality optional
|
||||
o String addressCountry optional
|
||||
}`,
|
||||
'filename.cto'
|
||||
);
|
||||
|
||||
const factory = new Factory(modelManager);
|
||||
const postalAddress = factory.newConcept('org.acme.address', 'PostalAddress');
|
||||
postalAddress.streetAddress = '1 Maine Street';
|
||||
|
||||
const serializer = new Serializer(factory, modelManager);
|
||||
const plainJsObject = serializer.toJSON(postalAddress);
|
||||
|
||||
const sPostalAddress = serializer.fromJSON(plainJsObject);
|
||||
const streetAddress: string = sPostalAddress.streetAddress;
|
||||
Vendored
-1128
File diff suppressed because it is too large
Load Diff
@@ -1,23 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"composer-concerto-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Reference in New Issue
Block a user