@enonic-types/guillotine 0.0.1 → 0.0.2

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.
package/README.md CHANGED
@@ -14,44 +14,44 @@ const MY_FIELD_NAME = 'myField';
14
14
 
15
15
 
16
16
  export const extensions = (graphQL: GraphQL): Extensions => {
17
- return {
18
- types: {
19
- [MY_OBJECT_TYPE_NAME]: {
20
- description: 'Description for my object type',
21
- fields: {
22
- myString: {
23
- type: graphQL.nonNull(graphQL.GraphQLString),
24
- }
25
- }
26
- }
27
- },
28
- creationCallbacks: {
29
- [ObjectTypeName.Content]: (params) => {
30
- params.addFields({
31
- [MY_FIELD_NAME]: {
32
- type: graphQL.reference(MY_OBJECT_TYPE_NAME) // nullable
33
- }
34
- });
35
- }
36
- },
37
- resolvers: {
38
- [ObjectTypeName.Content]: {
39
- [MY_FIELD_NAME]: () => {
40
- const {
41
- // args,
42
- // localContext,
43
- source: content
44
- } = env;
45
- if (content.type === 'portal:fragment') {
46
- return null;
47
- }
48
- return {
49
- myString: 'Hello, World!'
50
- }
51
- },
52
- }
53
- }
54
- }
17
+ return {
18
+ types: {
19
+ [MY_OBJECT_TYPE_NAME]: {
20
+ description: 'Description for my object type',
21
+ fields: {
22
+ myString: {
23
+ type: graphQL.nonNull(graphQL.GraphQLString),
24
+ }
25
+ }
26
+ }
27
+ },
28
+ creationCallbacks: {
29
+ [ObjectTypeName.Content]: (params) => {
30
+ params.addFields({
31
+ [MY_FIELD_NAME]: {
32
+ type: graphQL.reference(MY_OBJECT_TYPE_NAME)
33
+ }
34
+ });
35
+ }
36
+ },
37
+ resolvers: {
38
+ [ObjectTypeName.Content]: {
39
+ [MY_FIELD_NAME]: () => {
40
+ const {
41
+ // args,
42
+ // localContext,
43
+ source: content
44
+ } = env;
45
+ if (content.type === 'portal:fragment') {
46
+ return null;
47
+ }
48
+ return {
49
+ myString: 'Hello, World!'
50
+ }
51
+ },
52
+ }
53
+ }
54
+ }
55
55
  };
56
56
 
57
57
  ```
package/advanced.ts CHANGED
@@ -121,7 +121,9 @@ export type {
121
121
  } from './guillotine'
122
122
 
123
123
  export type {
124
+ BaseFolderContent,
124
125
  MediaImageContent,
126
+ PortalSiteContent,
125
127
  } from './xp'
126
128
 
127
129
 
package/index.ts CHANGED
@@ -142,6 +142,13 @@ export declare interface Extensions {
142
142
  }
143
143
 
144
144
 
145
+ export type {
146
+ BaseFolderContent,
147
+ MediaImageContent,
148
+ PortalSiteContent,
149
+ } from './xp'
150
+
151
+
145
152
  export {
146
153
  EnumTypeName,
147
154
  FormItemType,
package/package.json CHANGED
@@ -45,5 +45,5 @@
45
45
  "test": "tsd ./"
46
46
  },
47
47
  "types": "index.ts",
48
- "version": "0.0.1"
48
+ "version": "0.0.2"
49
49
  }
package/xp/index.d.ts CHANGED
@@ -2,6 +2,8 @@ import type {Content} from '@enonic-types/core';
2
2
  import type {Site} from '@enonic-types/lib-content';
3
3
 
4
4
 
5
+ export declare type BaseFolderContent = Content<{}, 'base:folder'>;
6
+
5
7
  export declare type MediaImageContent = Content<{
6
8
  altText?: string
7
9
  artist?: string[]