@teambit/schema 0.0.749 → 0.0.752

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,11 @@
1
1
  /// <reference types="react" />
2
2
  export declare const BasicButton: () => JSX.Element;
3
+ /**
4
+ * example of passing a JSX Element as a parameter
5
+ */
6
+ export declare function Footer({ children }: {
7
+ children?: JSX.Element | undefined;
8
+ }): JSX.Element;
3
9
  export declare const ButtonWithCustomStyles: () => JSX.Element;
4
10
  export declare const ButtonWithIcon: () => JSX.Element;
5
11
  export declare const ButtonAsALink: () => JSX.Element;
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.ButtonWithIcon = exports.ButtonWithCustomStyles = exports.ButtonAsALink = exports.BasicButton = void 0;
9
+ exports.Footer = Footer;
9
10
 
10
11
  function _react() {
11
12
  const data = _interopRequireDefault(require("react"));
@@ -33,9 +34,19 @@ function _button() {
33
34
  const BasicButton = () => {
34
35
  return /*#__PURE__*/_react().default.createElement(_button().Button, null, "click me");
35
36
  };
37
+ /**
38
+ * example of passing a JSX Element as a parameter
39
+ */
40
+
36
41
 
37
42
  exports.BasicButton = BasicButton;
38
43
 
44
+ function Footer({
45
+ children = /*#__PURE__*/_react().default.createElement(BasicButton, null)
46
+ }) {
47
+ return /*#__PURE__*/_react().default.createElement(_button().Button, null, children);
48
+ }
49
+
39
50
  const ButtonWithCustomStyles = () => {
40
51
  return /*#__PURE__*/_react().default.createElement(_button().Button, {
41
52
  style: {
@@ -1 +1 @@
1
- {"version":3,"names":["BasicButton","ButtonWithCustomStyles","background","ButtonWithIcon","ButtonAsALink"],"sources":["button.composition.tsx"],"sourcesContent":["/* eslint-disable no-alert */\n/* eslint-disable @typescript-eslint/no-unused-vars */\nimport React from 'react';\nimport { Button } from './button';\n\nexport const BasicButton = () => {\n return <Button>click me</Button>;\n};\n\nexport const ButtonWithCustomStyles = () => {\n return <Button style={{ background: 'red' }}>click me</Button>;\n};\n\nexport const ButtonWithIcon = () => {\n return (\n <Button>\n {/* <Image src=\"https://static.bit.dev/bit-logo.svg\" /> */}\n click me\n </Button>\n );\n};\n\nexport const ButtonAsALink = () => {\n return <Button href=\"https://bit.dev\">Bit</Button>;\n};\n"],"mappings":";;;;;;;;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAHA;;AACA;AAIO,MAAMA,WAAW,GAAG,MAAM;EAC/B,oBAAO,+BAAC,gBAAD,mBAAP;AACD,CAFM;;;;AAIA,MAAMC,sBAAsB,GAAG,MAAM;EAC1C,oBAAO,+BAAC,gBAAD;IAAQ,KAAK,EAAE;MAAEC,UAAU,EAAE;IAAd;EAAf,cAAP;AACD,CAFM;;;;AAIA,MAAMC,cAAc,GAAG,MAAM;EAClC,oBACE,+BAAC,gBAAD,mBADF;AAMD,CAPM;;;;AASA,MAAMC,aAAa,GAAG,MAAM;EACjC,oBAAO,+BAAC,gBAAD;IAAQ,IAAI,EAAC;EAAb,SAAP;AACD,CAFM"}
1
+ {"version":3,"names":["BasicButton","Footer","children","ButtonWithCustomStyles","background","ButtonWithIcon","ButtonAsALink"],"sources":["button.composition.tsx"],"sourcesContent":["/* eslint-disable no-alert */\n/* eslint-disable @typescript-eslint/no-unused-vars */\nimport React from 'react';\nimport { Button } from './button';\n\nexport const BasicButton = () => {\n return <Button>click me</Button>;\n};\n\n/**\n * example of passing a JSX Element as a parameter\n */\nexport function Footer({ children = <BasicButton /> }) {\n return <Button>{children}</Button>;\n}\n\nexport const ButtonWithCustomStyles = () => {\n return <Button style={{ background: 'red' }}>click me</Button>;\n};\n\nexport const ButtonWithIcon = () => {\n return (\n <Button>\n {/* <Image src=\"https://static.bit.dev/bit-logo.svg\" /> */}\n click me\n </Button>\n );\n};\n\nexport const ButtonAsALink = () => {\n return <Button href=\"https://bit.dev\">Bit</Button>;\n};\n"],"mappings":";;;;;;;;;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAHA;;AACA;AAIO,MAAMA,WAAW,GAAG,MAAM;EAC/B,oBAAO,+BAAC,gBAAD,mBAAP;AACD,CAFM;AAIP;AACA;AACA;;;;;AACO,SAASC,MAAT,CAAgB;EAAEC,QAAQ,gBAAG,+BAAC,WAAD;AAAb,CAAhB,EAAgD;EACrD,oBAAO,+BAAC,gBAAD,QAASA,QAAT,CAAP;AACD;;AAEM,MAAMC,sBAAsB,GAAG,MAAM;EAC1C,oBAAO,+BAAC,gBAAD;IAAQ,KAAK,EAAE;MAAEC,UAAU,EAAE;IAAd;EAAf,cAAP;AACD,CAFM;;;;AAIA,MAAMC,cAAc,GAAG,MAAM;EAClC,oBACE,+BAAC,gBAAD,mBADF;AAMD,CAPM;;;;AASA,MAAMC,aAAa,GAAG,MAAM;EACjC,oBAAO,+BAAC,gBAAD;IAAQ,IAAI,EAAC;EAAb,SAAP;AACD,CAFM"}
@@ -78,3 +78,6 @@ export interface ComputedNameNoType {
78
78
  declare type World1 = 'world1-a' | 'world1-b';
79
79
  declare type World2 = 'world2';
80
80
  export declare type templateLiteralType = `hello ${World1} hi ${World2}`;
81
+ export interface CallSignatureWithTypeParams {
82
+ <T>(a: string): T;
83
+ }
@@ -1 +1 @@
1
- {"version":3,"names":["myFunc","a","b","Hi","HiThere","Function","Array","Foo","ClassSomething","constructor","da","getter","setter","obj","a1","Bar","foo","getBar","bar","tuple","c","Food","getPromise","T1","T2","T3","typePredicateFn","str","typePredicateNoTypeFn","condition","msg","objectBindingElements","prop","arrayBindingElements","computedName"],"sources":["index.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-empty-function */\n/* eslint-disable @typescript-eslint/no-shadow */\n/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable @typescript-eslint/prefer-as-const */\n/* eslint-disable one-var */\n/* eslint-disable max-classes-per-file */\n/**\n *\n * @param a this is A\n * @param b this is B\n * @returns\n */\nexport function myFunc(a = 4, b = 5): number {\n return a + b;\n}\n\nexport * from './button';\n\nexport function Hi() {}\n\nexport const a = 4,\n b: 5 = 5;\n\nexport * as Compositions from './button.composition';\n\nexport const HiThere = 'HiThere';\n\nexport const Function = () => {};\n\nexport const Array = ['hi', 'there'];\n\nclass Foo {}\n\nclass ClassSomething {\n app = '';\n constructor(readonly da: 'dsa') {}\n\n a() {\n return new Foo();\n }\n get getter() {\n return 'hi';\n }\n\n set setter(a: boolean) {}\n}\n\nexport { ClassSomething };\n\nexport type IndexSig = { [key: string]: boolean };\n\nexport interface Hello {\n propertySig: () => void;\n methodSig(): string;\n}\n\nconst obj = { a: 1, b: 2 };\n\nexport const a1: typeof obj = { a: 5, b: 9 };\n\nexport type TypeOperator = keyof typeof obj;\n\n// this is for Jump in the definition\nclass Bar {\n foo() {}\n}\nexport const getBar = (bar: Bar) => new Bar();\n\nexport const tuple = ([a, b, c]: [string, Function, Record<string, any>]) => {};\n\nexport enum Food {\n Falafel,\n Hummus,\n Tahini,\n}\n\nexport async function getPromise(): Promise<string> {\n return 'promise';\n}\n\nclass T1 {}\nclass T2 {}\nclass T3<T, K> {}\nexport type TypeRefWithArgs = T3<T1, T2>;\n\nexport type ParenthesizedType = (T1 | T2)[];\n\nexport function typePredicateFn(str: any): str is string {\n return str;\n}\n\nexport function typePredicateNoTypeFn(condition: any, msg?: string): asserts condition {}\n\nexport async function objectBindingElements({ prop = 1 }) {\n return prop;\n}\nexport async function arrayBindingElements([prop]: [string]) {\n return prop;\n}\n\ninterface config {\n someField: { a: string; b: boolean };\n}\nexport type IndexedAccessType = config['someField'];\n\nconst computedName = 'str';\nexport interface ComputedNameWithType {\n [computedName]: boolean;\n}\nexport interface ComputedNameNoType {\n [computedName];\n}\n\ntype World1 = 'world1-a' | 'world1-b';\ntype World2 = 'world2';\nexport type templateLiteralType = `hello ${World1} hi ${World2}`;\n"],"mappings":";;;;;;;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,EAAOkB,CAAP,CAAD,KAAwD,CAAE,CAAxE;;;IAEKC,I;;;WAAAA,I;EAAAA,I,CAAAA,I;EAAAA,I,CAAAA,I;EAAAA,I,CAAAA,I;GAAAA,I,oBAAAA,I;;AAML,eAAeC,UAAf,GAA6C;EAClD,OAAO,SAAP;AACD;;AAED,MAAMC,EAAN,CAAS;;AACT,MAAMC,EAAN,CAAS;;AACT,MAAMC,EAAN,CAAe;;AAKR,SAASC,eAAT,CAAyBC,GAAzB,EAAkD;EACvD,OAAOA,GAAP;AACD;;AAEM,SAASC,qBAAT,CAA+BC,SAA/B,EAA+CC,GAA/C,EAAgF,CAAE;;AAElF,eAAeC,qBAAf,CAAqC;EAAEC,IAAI,GAAG;AAAT,CAArC,EAAmD;EACxD,OAAOA,IAAP;AACD;;AACM,eAAeC,oBAAf,CAAoC,CAACD,IAAD,CAApC,EAAsD;EAC3D,OAAOA,IAAP;AACD;;AAOD,MAAME,YAAY,GAAG,KAArB"}
1
+ {"version":3,"names":["myFunc","a","b","Hi","HiThere","Function","Array","Foo","ClassSomething","constructor","da","getter","setter","obj","a1","Bar","foo","getBar","bar","tuple","c","Food","getPromise","T1","T2","T3","typePredicateFn","str","typePredicateNoTypeFn","condition","msg","objectBindingElements","prop","arrayBindingElements","computedName"],"sources":["index.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-empty-function */\n/* eslint-disable @typescript-eslint/no-shadow */\n/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable @typescript-eslint/prefer-as-const */\n/* eslint-disable one-var */\n/* eslint-disable max-classes-per-file */\n/**\n *\n * @param a this is A\n * @param b this is B\n * @returns\n */\nexport function myFunc(a = 4, b = 5): number {\n return a + b;\n}\n\nexport * from './button';\n\nexport function Hi() {}\n\nexport const a = 4,\n b: 5 = 5;\n\nexport * as Compositions from './button.composition';\n\nexport const HiThere = 'HiThere';\n\nexport const Function = () => {};\n\nexport const Array = ['hi', 'there'];\n\nclass Foo {}\n\nclass ClassSomething {\n app = '';\n constructor(readonly da: 'dsa') {}\n\n a() {\n return new Foo();\n }\n get getter() {\n return 'hi';\n }\n\n set setter(a: boolean) {}\n}\n\nexport { ClassSomething };\n\nexport type IndexSig = { [key: string]: boolean };\n\nexport interface Hello {\n propertySig: () => void;\n methodSig(): string;\n}\n\nconst obj = { a: 1, b: 2 };\n\nexport const a1: typeof obj = { a: 5, b: 9 };\n\nexport type TypeOperator = keyof typeof obj;\n\n// this is for Jump in the definition\nclass Bar {\n foo() {}\n}\nexport const getBar = (bar: Bar) => new Bar();\n\nexport const tuple = ([a, b, c]: [string, Function, Record<string, any>]) => {};\n\nexport enum Food {\n Falafel,\n Hummus,\n Tahini,\n}\n\nexport async function getPromise(): Promise<string> {\n return 'promise';\n}\n\nclass T1 {}\nclass T2 {}\nclass T3<T, K> {}\nexport type TypeRefWithArgs = T3<T1, T2>;\n\nexport type ParenthesizedType = (T1 | T2)[];\n\nexport function typePredicateFn(str: any): str is string {\n return str;\n}\n\nexport function typePredicateNoTypeFn(condition: any, msg?: string): asserts condition {}\n\nexport async function objectBindingElements({ prop = 1 }) {\n return prop;\n}\nexport async function arrayBindingElements([prop]: [string]) {\n return prop;\n}\n\ninterface config {\n someField: { a: string; b: boolean };\n}\nexport type IndexedAccessType = config['someField'];\n\nconst computedName = 'str';\nexport interface ComputedNameWithType {\n [computedName]: boolean;\n}\nexport interface ComputedNameNoType {\n [computedName];\n}\n\ntype World1 = 'world1-a' | 'world1-b';\ntype World2 = 'world2';\nexport type templateLiteralType = `hello ${World1} hi ${World2}`;\n\nexport interface CallSignatureWithTypeParams {\n <T>(a: string): T;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;AAhBA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;AACA;AACA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EAAN,CAAS;;AACT,MAAMC,EAAN,CAAS;;AACT,MAAMC,EAAN,CAAe;;AAKR,SAASC,eAAT,CAAyBC,GAAzB,EAAkD;EACvD,OAAOA,GAAP;AACD;;AAEM,SAASC,qBAAT,CAA+BC,SAA/B,EAA+CC,GAA/C,EAAgF,CAAE;;AAElF,eAAeC,qBAAf,CAAqC;EAAEC,IAAI,GAAG;AAAT,CAArC,EAAmD;EACxD,OAAOA,IAAP;AACD;;AACM,eAAeC,oBAAf,CAAoC,CAACD,IAAD,CAApC,EAAsD;EAC3D,OAAOA,IAAP;AACD;;AAOD,MAAME,YAAY,GAAG,KAArB"}
@@ -73,6 +73,45 @@
73
73
  "character": 39
74
74
  },
75
75
  "name": "number"
76
+ },
77
+ "doc": {
78
+ "__schema": "DocSchema",
79
+ "location": {
80
+ "file": "index.ts",
81
+ "line": 7,
82
+ "character": 1
83
+ },
84
+ "tags": [
85
+ {
86
+ "__schema": "TagSchema",
87
+ "location": {
88
+ "file": "index.ts",
89
+ "line": 9,
90
+ "character": 4
91
+ },
92
+ "tagName": "implements",
93
+ "comment": "this is A"
94
+ },
95
+ {
96
+ "__schema": "TagSchema",
97
+ "location": {
98
+ "file": "index.ts",
99
+ "line": 10,
100
+ "character": 4
101
+ },
102
+ "tagName": "implements",
103
+ "comment": "this is B"
104
+ },
105
+ {
106
+ "__schema": "ReturnTagSchema",
107
+ "location": {
108
+ "file": "index.ts",
109
+ "line": 11,
110
+ "character": 4
111
+ },
112
+ "tagName": "return"
113
+ }
114
+ ]
76
115
  }
77
116
  },
78
117
  {
@@ -375,7 +414,69 @@
375
414
  "__schema": "FunctionLikeSchema",
376
415
  "location": {
377
416
  "file": "button.composition.tsx",
378
- "line": 10,
417
+ "line": 13,
418
+ "character": 1
419
+ },
420
+ "name": "Footer",
421
+ "signature": "function Footer({ children }: {\n children?: any;\n}): any",
422
+ "modifiers": [
423
+ "export"
424
+ ],
425
+ "params": [
426
+ {
427
+ "__schema": "ParameterSchema",
428
+ "location": {
429
+ "file": "button.composition.tsx",
430
+ "line": 13,
431
+ "character": 24
432
+ },
433
+ "name": "{ children = <BasicButton /> }",
434
+ "type": {
435
+ "__schema": "TypeLiteralSchema",
436
+ "location": {
437
+ "file": "button.composition.tsx",
438
+ "line": 13,
439
+ "character": 24
440
+ },
441
+ "members": [
442
+ {
443
+ "__schema": "InferenceTypeSchema",
444
+ "location": {
445
+ "file": "button.composition.tsx",
446
+ "line": 13,
447
+ "character": 24
448
+ },
449
+ "type": "any",
450
+ "name": "children"
451
+ }
452
+ ]
453
+ }
454
+ }
455
+ ],
456
+ "returnType": {
457
+ "__schema": "InferenceTypeSchema",
458
+ "location": {
459
+ "file": "button.composition.tsx",
460
+ "line": 13,
461
+ "character": 1
462
+ },
463
+ "type": "any"
464
+ },
465
+ "doc": {
466
+ "__schema": "DocSchema",
467
+ "location": {
468
+ "file": "button.composition.tsx",
469
+ "line": 10,
470
+ "character": 1
471
+ },
472
+ "comment": "example of passing a JSX Element as a parameter"
473
+ }
474
+ },
475
+ {
476
+ "__schema": "FunctionLikeSchema",
477
+ "location": {
478
+ "file": "button.composition.tsx",
479
+ "line": 17,
379
480
  "character": 14
380
481
  },
381
482
  "name": "ButtonWithCustomStyles",
@@ -386,7 +487,7 @@
386
487
  "__schema": "InferenceTypeSchema",
387
488
  "location": {
388
489
  "file": "button.composition.tsx",
389
- "line": 10,
490
+ "line": 17,
390
491
  "character": 14
391
492
  },
392
493
  "type": "any"
@@ -396,7 +497,7 @@
396
497
  "__schema": "FunctionLikeSchema",
397
498
  "location": {
398
499
  "file": "button.composition.tsx",
399
- "line": 14,
500
+ "line": 21,
400
501
  "character": 14
401
502
  },
402
503
  "name": "ButtonWithIcon",
@@ -407,7 +508,7 @@
407
508
  "__schema": "InferenceTypeSchema",
408
509
  "location": {
409
510
  "file": "button.composition.tsx",
410
- "line": 14,
511
+ "line": 21,
411
512
  "character": 14
412
513
  },
413
514
  "type": "any"
@@ -417,7 +518,7 @@
417
518
  "__schema": "FunctionLikeSchema",
418
519
  "location": {
419
520
  "file": "button.composition.tsx",
420
- "line": 23,
521
+ "line": 30,
421
522
  "character": 14
422
523
  },
423
524
  "name": "ButtonAsALink",
@@ -428,7 +529,7 @@
428
529
  "__schema": "InferenceTypeSchema",
429
530
  "location": {
430
531
  "file": "button.composition.tsx",
431
- "line": 23,
532
+ "line": 30,
432
533
  "character": 14
433
534
  },
434
535
  "type": "any"
@@ -1432,6 +1533,60 @@
1432
1533
  }
1433
1534
  ]
1434
1535
  }
1536
+ },
1537
+ {
1538
+ "__schema": "InterfaceSchema",
1539
+ "location": {
1540
+ "file": "index.ts",
1541
+ "line": 118,
1542
+ "character": 1
1543
+ },
1544
+ "name": "CallSignatureWithTypeParams",
1545
+ "members": [
1546
+ {
1547
+ "__schema": "FunctionLikeSchema",
1548
+ "location": {
1549
+ "file": "index.ts",
1550
+ "line": 119,
1551
+ "character": 3
1552
+ },
1553
+ "name": "",
1554
+ "signature": "",
1555
+ "modifiers": [],
1556
+ "typeParams": [
1557
+ "T"
1558
+ ],
1559
+ "params": [
1560
+ {
1561
+ "__schema": "ParameterSchema",
1562
+ "location": {
1563
+ "file": "index.ts",
1564
+ "line": 119,
1565
+ "character": 7
1566
+ },
1567
+ "name": "a",
1568
+ "type": {
1569
+ "__schema": "KeywordTypeSchema",
1570
+ "location": {
1571
+ "file": "index.ts",
1572
+ "line": 119,
1573
+ "character": 10
1574
+ },
1575
+ "name": "string"
1576
+ }
1577
+ }
1578
+ ],
1579
+ "returnType": {
1580
+ "__schema": "InferenceTypeSchema",
1581
+ "location": {
1582
+ "file": "index.ts",
1583
+ "line": 119,
1584
+ "character": 19
1585
+ },
1586
+ "type": "T"
1587
+ }
1588
+ }
1589
+ ]
1435
1590
  }
1436
1591
  ]
1437
1592
  },
@@ -7,6 +7,13 @@ export const BasicButton = () => {
7
7
  return <Button>click me</Button>;
8
8
  };
9
9
 
10
+ /**
11
+ * example of passing a JSX Element as a parameter
12
+ */
13
+ export function Footer({ children = <BasicButton /> }) {
14
+ return <Button>{children}</Button>;
15
+ }
16
+
10
17
  export const ButtonWithCustomStyles = () => {
11
18
  return <Button style={{ background: 'red' }}>click me</Button>;
12
19
  };
@@ -114,3 +114,7 @@ export interface ComputedNameNoType {
114
114
  type World1 = 'world1-a' | 'world1-b';
115
115
  type World2 = 'world2';
116
116
  export type templateLiteralType = `hello ${World1} hi ${World2}`;
117
+
118
+ export interface CallSignatureWithTypeParams {
119
+ <T>(a: string): T;
120
+ }
@@ -73,6 +73,45 @@
73
73
  "character": 39
74
74
  },
75
75
  "name": "number"
76
+ },
77
+ "doc": {
78
+ "__schema": "DocSchema",
79
+ "location": {
80
+ "file": "index.ts",
81
+ "line": 7,
82
+ "character": 1
83
+ },
84
+ "tags": [
85
+ {
86
+ "__schema": "TagSchema",
87
+ "location": {
88
+ "file": "index.ts",
89
+ "line": 9,
90
+ "character": 4
91
+ },
92
+ "tagName": "implements",
93
+ "comment": "this is A"
94
+ },
95
+ {
96
+ "__schema": "TagSchema",
97
+ "location": {
98
+ "file": "index.ts",
99
+ "line": 10,
100
+ "character": 4
101
+ },
102
+ "tagName": "implements",
103
+ "comment": "this is B"
104
+ },
105
+ {
106
+ "__schema": "ReturnTagSchema",
107
+ "location": {
108
+ "file": "index.ts",
109
+ "line": 11,
110
+ "character": 4
111
+ },
112
+ "tagName": "return"
113
+ }
114
+ ]
76
115
  }
77
116
  },
78
117
  {
@@ -375,7 +414,69 @@
375
414
  "__schema": "FunctionLikeSchema",
376
415
  "location": {
377
416
  "file": "button.composition.tsx",
378
- "line": 10,
417
+ "line": 13,
418
+ "character": 1
419
+ },
420
+ "name": "Footer",
421
+ "signature": "function Footer({ children }: {\n children?: any;\n}): any",
422
+ "modifiers": [
423
+ "export"
424
+ ],
425
+ "params": [
426
+ {
427
+ "__schema": "ParameterSchema",
428
+ "location": {
429
+ "file": "button.composition.tsx",
430
+ "line": 13,
431
+ "character": 24
432
+ },
433
+ "name": "{ children = <BasicButton /> }",
434
+ "type": {
435
+ "__schema": "TypeLiteralSchema",
436
+ "location": {
437
+ "file": "button.composition.tsx",
438
+ "line": 13,
439
+ "character": 24
440
+ },
441
+ "members": [
442
+ {
443
+ "__schema": "InferenceTypeSchema",
444
+ "location": {
445
+ "file": "button.composition.tsx",
446
+ "line": 13,
447
+ "character": 24
448
+ },
449
+ "type": "any",
450
+ "name": "children"
451
+ }
452
+ ]
453
+ }
454
+ }
455
+ ],
456
+ "returnType": {
457
+ "__schema": "InferenceTypeSchema",
458
+ "location": {
459
+ "file": "button.composition.tsx",
460
+ "line": 13,
461
+ "character": 1
462
+ },
463
+ "type": "any"
464
+ },
465
+ "doc": {
466
+ "__schema": "DocSchema",
467
+ "location": {
468
+ "file": "button.composition.tsx",
469
+ "line": 10,
470
+ "character": 1
471
+ },
472
+ "comment": "example of passing a JSX Element as a parameter"
473
+ }
474
+ },
475
+ {
476
+ "__schema": "FunctionLikeSchema",
477
+ "location": {
478
+ "file": "button.composition.tsx",
479
+ "line": 17,
379
480
  "character": 14
380
481
  },
381
482
  "name": "ButtonWithCustomStyles",
@@ -386,7 +487,7 @@
386
487
  "__schema": "InferenceTypeSchema",
387
488
  "location": {
388
489
  "file": "button.composition.tsx",
389
- "line": 10,
490
+ "line": 17,
390
491
  "character": 14
391
492
  },
392
493
  "type": "any"
@@ -396,7 +497,7 @@
396
497
  "__schema": "FunctionLikeSchema",
397
498
  "location": {
398
499
  "file": "button.composition.tsx",
399
- "line": 14,
500
+ "line": 21,
400
501
  "character": 14
401
502
  },
402
503
  "name": "ButtonWithIcon",
@@ -407,7 +508,7 @@
407
508
  "__schema": "InferenceTypeSchema",
408
509
  "location": {
409
510
  "file": "button.composition.tsx",
410
- "line": 14,
511
+ "line": 21,
411
512
  "character": 14
412
513
  },
413
514
  "type": "any"
@@ -417,7 +518,7 @@
417
518
  "__schema": "FunctionLikeSchema",
418
519
  "location": {
419
520
  "file": "button.composition.tsx",
420
- "line": 23,
521
+ "line": 30,
421
522
  "character": 14
422
523
  },
423
524
  "name": "ButtonAsALink",
@@ -428,7 +529,7 @@
428
529
  "__schema": "InferenceTypeSchema",
429
530
  "location": {
430
531
  "file": "button.composition.tsx",
431
- "line": 23,
532
+ "line": 30,
432
533
  "character": 14
433
534
  },
434
535
  "type": "any"
@@ -1432,6 +1533,60 @@
1432
1533
  }
1433
1534
  ]
1434
1535
  }
1536
+ },
1537
+ {
1538
+ "__schema": "InterfaceSchema",
1539
+ "location": {
1540
+ "file": "index.ts",
1541
+ "line": 118,
1542
+ "character": 1
1543
+ },
1544
+ "name": "CallSignatureWithTypeParams",
1545
+ "members": [
1546
+ {
1547
+ "__schema": "FunctionLikeSchema",
1548
+ "location": {
1549
+ "file": "index.ts",
1550
+ "line": 119,
1551
+ "character": 3
1552
+ },
1553
+ "name": "",
1554
+ "signature": "",
1555
+ "modifiers": [],
1556
+ "typeParams": [
1557
+ "T"
1558
+ ],
1559
+ "params": [
1560
+ {
1561
+ "__schema": "ParameterSchema",
1562
+ "location": {
1563
+ "file": "index.ts",
1564
+ "line": 119,
1565
+ "character": 7
1566
+ },
1567
+ "name": "a",
1568
+ "type": {
1569
+ "__schema": "KeywordTypeSchema",
1570
+ "location": {
1571
+ "file": "index.ts",
1572
+ "line": 119,
1573
+ "character": 10
1574
+ },
1575
+ "name": "string"
1576
+ }
1577
+ }
1578
+ ],
1579
+ "returnType": {
1580
+ "__schema": "InferenceTypeSchema",
1581
+ "location": {
1582
+ "file": "index.ts",
1583
+ "line": 119,
1584
+ "character": 19
1585
+ },
1586
+ "type": "T"
1587
+ }
1588
+ }
1589
+ ]
1435
1590
  }
1436
1591
  ]
1437
1592
  },
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/schema",
3
- "version": "0.0.749",
3
+ "version": "0.0.752",
4
4
  "homepage": "https://bit.dev/teambit/semantics/schema",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.semantics",
8
8
  "name": "schema",
9
- "version": "0.0.749"
9
+ "version": "0.0.752"
10
10
  },
11
11
  "dependencies": {
12
12
  "p-map-series": "2.1.0",
@@ -16,13 +16,13 @@
16
16
  "core-js": "^3.0.0",
17
17
  "@teambit/harmony": "0.3.3",
18
18
  "@teambit/base-react.navigation.link": "2.0.27",
19
- "@teambit/semantics.entities.semantic-schema": "0.0.16",
20
- "@teambit/builder": "0.0.749",
21
- "@teambit/component": "0.0.749",
22
- "@teambit/cli": "0.0.494",
23
- "@teambit/logger": "0.0.587",
24
- "@teambit/envs": "0.0.749",
25
- "@teambit/graphql": "0.0.749"
19
+ "@teambit/semantics.entities.semantic-schema": "0.0.17",
20
+ "@teambit/builder": "0.0.752",
21
+ "@teambit/component": "0.0.752",
22
+ "@teambit/cli": "0.0.496",
23
+ "@teambit/logger": "0.0.589",
24
+ "@teambit/envs": "0.0.752",
25
+ "@teambit/graphql": "0.0.752"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@types/react": "^17.0.8",
@@ -36,10 +36,10 @@
36
36
  "@teambit/component-id": "0.0.402",
37
37
  "@teambit/harmony.testing.load-aspect": "0.0.6",
38
38
  "@teambit/workspace.testing.mock-workspace": "0.0.5",
39
- "@teambit/workspace": "0.0.749"
39
+ "@teambit/workspace": "0.0.752"
40
40
  },
41
41
  "peerDependencies": {
42
- "@teambit/legacy": "1.0.274",
42
+ "@teambit/legacy": "1.0.276",
43
43
  "react-dom": "^16.8.0 || ^17.0.0",
44
44
  "react": "^16.8.0 || ^17.0.0"
45
45
  },
@@ -67,7 +67,7 @@
67
67
  "react": "-"
68
68
  },
69
69
  "peerDependencies": {
70
- "@teambit/legacy": "1.0.274",
70
+ "@teambit/legacy": "1.0.276",
71
71
  "react-dom": "^16.8.0 || ^17.0.0",
72
72
  "react": "^16.8.0 || ^17.0.0"
73
73
  }
@@ -1,2 +1,2 @@
1
- export const compositions = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.semantics_schema@0.0.749/dist/schema.composition.js'), require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.semantics_schema@0.0.749/dist/mock/button/button.composition.js')]
2
- export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.semantics_schema@0.0.749/dist/schema.docs.mdx')]
1
+ export const compositions = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.semantics_schema@0.0.752/dist/schema.composition.js'), require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.semantics_schema@0.0.752/dist/mock/button/button.composition.js')]
2
+ export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.semantics_schema@0.0.752/dist/schema.docs.mdx')]