@typespec/events 0.77.0 → 0.78.0-dev.1

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,4 +1,4 @@
1
- import type { DecoratorContext, ModelProperty, Union, UnionVariant } from "@typespec/compiler";
1
+ import type { DecoratorContext, DecoratorValidatorCallbacks, ModelProperty, Union, UnionVariant } from "@typespec/compiler";
2
2
  /**
3
3
  * Specify that this union describes a set of events.
4
4
  *
@@ -12,7 +12,7 @@ import type { DecoratorContext, ModelProperty, Union, UnionVariant } from "@type
12
12
  * }
13
13
  * ```
14
14
  */
15
- export type EventsDecorator = (context: DecoratorContext, target: Union) => void;
15
+ export type EventsDecorator = (context: DecoratorContext, target: Union) => DecoratorValidatorCallbacks | void;
16
16
  /**
17
17
  * Specifies the content type of the event envelope, event body, or event payload.
18
18
  * When applied to an event payload, that field must also have a corresponding `@data`
@@ -35,7 +35,7 @@ export type EventsDecorator = (context: DecoratorContext, target: Union) => void
35
35
  * }
36
36
  * ```
37
37
  */
38
- export type ContentTypeDecorator = (context: DecoratorContext, target: UnionVariant | ModelProperty, contentType: string) => void;
38
+ export type ContentTypeDecorator = (context: DecoratorContext, target: UnionVariant | ModelProperty, contentType: string) => DecoratorValidatorCallbacks | void;
39
39
  /**
40
40
  * Identifies the payload of an event.
41
41
  * Only one field in an event can be marked as the payload.
@@ -47,7 +47,7 @@ export type ContentTypeDecorator = (context: DecoratorContext, target: UnionVari
47
47
  * }
48
48
  * ```
49
49
  */
50
- export type DataDecorator = (context: DecoratorContext, target: ModelProperty) => void;
50
+ export type DataDecorator = (context: DecoratorContext, target: ModelProperty) => DecoratorValidatorCallbacks | void;
51
51
  export type TypeSpecEventsDecorators = {
52
52
  events: EventsDecorator;
53
53
  contentType: ContentTypeDecorator;
@@ -1 +1 @@
1
- {"version":3,"file":"TypeSpec.Events.d.ts","sourceRoot":"","sources":["../../generated-defs/TypeSpec.Events.ts"],"names":[],"mappings":"AAAA,OAA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EAAE,gBAAgB,EACzB,MAAM,EAAE,aAAa,KAClB,2BAA2B,GAAG,IAAI,CAAC;AAExC,MAAM,MAAM,wBAAwB,GAAG;IACrC,MAAM,EAAE,eAAe,CAAC;IACxB,WAAW,EAAE,oBAAoB,CAAC;IAClC,IAAI,EAAE,aAAa,CAAC;CACrB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typespec/events",
3
- "version": "0.77.0",
3
+ "version": "0.78.0-dev.1",
4
4
  "author": "Microsoft Corporation",
5
5
  "description": "TypeSpec library providing events bindings",
6
6
  "homepage": "https://typespec.io",
@@ -39,20 +39,21 @@
39
39
  "!dist/test/**"
40
40
  ],
41
41
  "peerDependencies": {
42
- "@typespec/compiler": "^1.7.0"
42
+ "@typespec/compiler": "^1.7.1"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@types/node": "~24.10.1",
46
+ "@typespec/compiler": "^1.7.1",
47
+ "@typespec/library-linter": "^0.77.0 || >=0.78.0-dev <0.78.0",
48
+ "@typespec/tspd": "^0.73.2 || >=0.74.0-dev <0.74.0",
46
49
  "@vitest/coverage-v8": "^4.0.4",
47
50
  "@vitest/ui": "^4.0.4",
48
51
  "c8": "^10.1.3",
49
52
  "rimraf": "~6.1.2",
50
53
  "typescript": "~5.9.2",
51
- "vitest": "^4.0.4",
52
- "@typespec/compiler": "^1.7.0",
53
- "@typespec/library-linter": "^0.77.0",
54
- "@typespec/tspd": "^0.73.2"
54
+ "vitest": "^4.0.4"
55
55
  },
56
+ "dependencies": {},
56
57
  "scripts": {
57
58
  "clean": "rimraf ./dist ./temp",
58
59
  "build": "pnpm gen-extern-signature && tsc -p . && pnpm lint-typespec-library",