@fedify/fedify 0.10.0 → 0.11.0-dev.228

Sign up to get free protection for your applications and to get access to all the features.
@@ -59,11 +59,11 @@ export function getActorClassByTypeName(typeName) {
59
59
  * ``` typescript
60
60
  * // Get the handle of an actor object:
61
61
  * await getActorHandle(
62
- * new Person({ id: new URL("https://todon.eu/users/hongminhee") })
62
+ * new Person({ id: new URL("https://fosstodon.org/users/hongminhee") })
63
63
  * );
64
64
  *
65
65
  * // Get the handle of an actor URI:
66
- * await getActorHandle(new URL("https://todon.eu/users/hongminhee"));
66
+ * await getActorHandle(new URL("https://fosstodon.org/users/hongminhee"));
67
67
  * ```
68
68
  *
69
69
  * @param actor The actor or actor URI to get the handle from.
@@ -11,15 +11,15 @@ const handleRegexp = /^@?((?:[-A-Za-z0-9._~!$&'()*+,;=]|%[A-Fa-f0-9]{2})+)@([^@]
11
11
  * @example
12
12
  * ``` typescript
13
13
  * // Look up an actor by its fediverse handle:
14
- * await lookupObject("@hongminhee@todon.eu");
14
+ * await lookupObject("@hongminhee@fosstodon.org");
15
15
  * // returning a `Person` object.
16
16
  *
17
17
  * // A fediverse handle can omit the leading '@':
18
- * await lookupObject("hongminhee@todon.eu");
18
+ * await lookupObject("hongminhee@fosstodon.org");
19
19
  * // returning a `Person` object.
20
20
  *
21
21
  * // A `acct:` URI can be used as well:
22
- * await lookupObject("acct:hongminhee@todon.eu");
22
+ * await lookupObject("acct:hongminhee@fosstodon.org");
23
23
  * // returning a `Person` object.
24
24
  *
25
25
  * // Look up an object by its URI:
@@ -0,0 +1,13 @@
1
+ $schema: ../codegen/schema.yaml
2
+ name: Offer
3
+ uri: "https://www.w3.org/ns/activitystreams#Offer"
4
+ extends: "https://www.w3.org/ns/activitystreams#Activity"
5
+ entity: true
6
+ description: |
7
+ Indicates that the actor is offering the object.
8
+ If specified, the target indicates the entity to which
9
+ the object is being offered.
10
+ defaultContext:
11
+ - "https://www.w3.org/ns/activitystreams"
12
+ - "https://w3id.org/security/data-integrity/v1"
13
+ properties: []
@@ -2210,6 +2210,10 @@ export class Object {
2210
2210
  delete values["@type"];
2211
2211
  return await Like.fromJsonLd(values, options);
2212
2212
  }
2213
+ if (values["@type"].includes("https://www.w3.org/ns/activitystreams#Offer")) {
2214
+ delete values["@type"];
2215
+ return await Offer.fromJsonLd(values, options);
2216
+ }
2213
2217
  if (values["@type"].includes("https://www.w3.org/ns/activitystreams#Reject")) {
2214
2218
  delete values["@type"];
2215
2219
  return await Reject.fromJsonLd(values, options);
@@ -2345,6 +2349,7 @@ export class Object {
2345
2349
  "https://www.w3.org/ns/activitystreams#Arrive",
2346
2350
  "https://www.w3.org/ns/activitystreams#Question",
2347
2351
  "https://www.w3.org/ns/activitystreams#Like",
2352
+ "https://www.w3.org/ns/activitystreams#Offer",
2348
2353
  "https://www.w3.org/ns/activitystreams#Reject",
2349
2354
  "https://www.w3.org/ns/activitystreams#Remove",
2350
2355
  "https://www.w3.org/ns/activitystreams#Undo",
@@ -2484,6 +2489,7 @@ export class Object {
2484
2489
  "https://www.w3.org/ns/activitystreams#Arrive",
2485
2490
  "https://www.w3.org/ns/activitystreams#Question",
2486
2491
  "https://www.w3.org/ns/activitystreams#Like",
2492
+ "https://www.w3.org/ns/activitystreams#Offer",
2487
2493
  "https://www.w3.org/ns/activitystreams#Reject",
2488
2494
  "https://www.w3.org/ns/activitystreams#Remove",
2489
2495
  "https://www.w3.org/ns/activitystreams#Undo",
@@ -2578,6 +2584,7 @@ export class Object {
2578
2584
  "https://www.w3.org/ns/activitystreams#Arrive",
2579
2585
  "https://www.w3.org/ns/activitystreams#Question",
2580
2586
  "https://www.w3.org/ns/activitystreams#Like",
2587
+ "https://www.w3.org/ns/activitystreams#Offer",
2581
2588
  "https://www.w3.org/ns/activitystreams#Reject",
2582
2589
  "https://www.w3.org/ns/activitystreams#Remove",
2583
2590
  "https://www.w3.org/ns/activitystreams#Undo",
@@ -2672,6 +2679,7 @@ export class Object {
2672
2679
  "https://www.w3.org/ns/activitystreams#Arrive",
2673
2680
  "https://www.w3.org/ns/activitystreams#Question",
2674
2681
  "https://www.w3.org/ns/activitystreams#Like",
2682
+ "https://www.w3.org/ns/activitystreams#Offer",
2675
2683
  "https://www.w3.org/ns/activitystreams#Reject",
2676
2684
  "https://www.w3.org/ns/activitystreams#Remove",
2677
2685
  "https://www.w3.org/ns/activitystreams#Undo",
@@ -2742,6 +2750,7 @@ export class Object {
2742
2750
  "https://www.w3.org/ns/activitystreams#Arrive",
2743
2751
  "https://www.w3.org/ns/activitystreams#Question",
2744
2752
  "https://www.w3.org/ns/activitystreams#Like",
2753
+ "https://www.w3.org/ns/activitystreams#Offer",
2745
2754
  "https://www.w3.org/ns/activitystreams#Reject",
2746
2755
  "https://www.w3.org/ns/activitystreams#Remove",
2747
2756
  "https://www.w3.org/ns/activitystreams#Undo",
@@ -2820,6 +2829,7 @@ export class Object {
2820
2829
  "https://www.w3.org/ns/activitystreams#Arrive",
2821
2830
  "https://www.w3.org/ns/activitystreams#Question",
2822
2831
  "https://www.w3.org/ns/activitystreams#Like",
2832
+ "https://www.w3.org/ns/activitystreams#Offer",
2823
2833
  "https://www.w3.org/ns/activitystreams#Reject",
2824
2834
  "https://www.w3.org/ns/activitystreams#Remove",
2825
2835
  "https://www.w3.org/ns/activitystreams#Undo",
@@ -2925,6 +2935,7 @@ export class Object {
2925
2935
  "https://www.w3.org/ns/activitystreams#Arrive",
2926
2936
  "https://www.w3.org/ns/activitystreams#Question",
2927
2937
  "https://www.w3.org/ns/activitystreams#Like",
2938
+ "https://www.w3.org/ns/activitystreams#Offer",
2928
2939
  "https://www.w3.org/ns/activitystreams#Reject",
2929
2940
  "https://www.w3.org/ns/activitystreams#Remove",
2930
2941
  "https://www.w3.org/ns/activitystreams#Undo",
@@ -5229,6 +5240,10 @@ export class Activity extends Object {
5229
5240
  delete values["@type"];
5230
5241
  return await Like.fromJsonLd(values, options);
5231
5242
  }
5243
+ if (values["@type"].includes("https://www.w3.org/ns/activitystreams#Offer")) {
5244
+ delete values["@type"];
5245
+ return await Offer.fromJsonLd(values, options);
5246
+ }
5232
5247
  if (values["@type"].includes("https://www.w3.org/ns/activitystreams#Reject")) {
5233
5248
  delete values["@type"];
5234
5249
  return await Reject.fromJsonLd(values, options);
@@ -8403,6 +8418,7 @@ export class Collection extends Object {
8403
8418
  "https://www.w3.org/ns/activitystreams#Arrive",
8404
8419
  "https://www.w3.org/ns/activitystreams#Question",
8405
8420
  "https://www.w3.org/ns/activitystreams#Like",
8421
+ "https://www.w3.org/ns/activitystreams#Offer",
8406
8422
  "https://www.w3.org/ns/activitystreams#Reject",
8407
8423
  "https://www.w3.org/ns/activitystreams#Remove",
8408
8424
  "https://www.w3.org/ns/activitystreams#Undo",
@@ -11801,6 +11817,7 @@ export class Link {
11801
11817
  "https://www.w3.org/ns/activitystreams#Arrive",
11802
11818
  "https://www.w3.org/ns/activitystreams#Question",
11803
11819
  "https://www.w3.org/ns/activitystreams#Like",
11820
+ "https://www.w3.org/ns/activitystreams#Offer",
11804
11821
  "https://www.w3.org/ns/activitystreams#Reject",
11805
11822
  "https://www.w3.org/ns/activitystreams#Remove",
11806
11823
  "https://www.w3.org/ns/activitystreams#Undo",
@@ -12505,6 +12522,118 @@ export class Note extends Object {
12505
12522
  return "Note " + inspect(proxy, options);
12506
12523
  }
12507
12524
  }
12525
+ /** Indicates that the actor is offering the object.
12526
+ * If specified, the target indicates the entity to which
12527
+ * the object is being offered.
12528
+ */
12529
+ export class Offer extends Activity {
12530
+ /**
12531
+ * The type URI of {@link Offer}: `https://www.w3.org/ns/activitystreams#Offer`.
12532
+ */
12533
+ static get typeId() {
12534
+ return new URL("https://www.w3.org/ns/activitystreams#Offer");
12535
+ }
12536
+ /**
12537
+ * Constructs a new instance of Offer with the given values.
12538
+ * @param values The values to initialize the instance with.
12539
+ * @param options The options to use for initialization.
12540
+ */
12541
+ constructor(values, { documentLoader, contextLoader, } = {}) {
12542
+ super(values, { documentLoader, contextLoader });
12543
+ }
12544
+ /**
12545
+ * Clones this instance, optionally updating it with the given values.
12546
+ * @param values The values to update the clone with.
12547
+ * @options The options to use for cloning.
12548
+ * @returns The cloned instance.
12549
+ */
12550
+ clone(values = {}, options = {}) {
12551
+ const clone = super.clone(values, options);
12552
+ return clone;
12553
+ }
12554
+ /**
12555
+ * Converts this object to a JSON-LD structure.
12556
+ * @returns The JSON-LD representation of this object.
12557
+ */
12558
+ async toJsonLd(options = {}) {
12559
+ options = {
12560
+ ...options,
12561
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
12562
+ };
12563
+ // deno-lint-ignore no-unused-vars prefer-const
12564
+ let array;
12565
+ const baseValues = await super.toJsonLd({
12566
+ ...options,
12567
+ expand: true,
12568
+ });
12569
+ const values = baseValues[0];
12570
+ values["@type"] = ["https://www.w3.org/ns/activitystreams#Offer"];
12571
+ if (this.id)
12572
+ values["@id"] = this.id.href;
12573
+ if (options.expand) {
12574
+ return await jsonld.expand(values, { documentLoader: options.contextLoader });
12575
+ }
12576
+ return await jsonld.compact(values, options.context ??
12577
+ [
12578
+ "https://www.w3.org/ns/activitystreams",
12579
+ "https://w3id.org/security/data-integrity/v1",
12580
+ ], { documentLoader: options.contextLoader });
12581
+ }
12582
+ /**
12583
+ * Converts a JSON-LD structure to an object of this type.
12584
+ * @param json The JSON-LD structure to convert.
12585
+ * @returns The object of this type.
12586
+ * @throws {TypeError} If the given `json` is invalid.
12587
+ */
12588
+ static async fromJsonLd(json, options = {}) {
12589
+ if (typeof json === "undefined") {
12590
+ throw new TypeError("Invalid JSON-LD: undefined.");
12591
+ }
12592
+ else if (json === null)
12593
+ throw new TypeError("Invalid JSON-LD: null.");
12594
+ options = {
12595
+ ...options,
12596
+ documentLoader: options.documentLoader ?? fetchDocumentLoader,
12597
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
12598
+ };
12599
+ // deno-lint-ignore no-explicit-any
12600
+ let values;
12601
+ if (globalThis.Object.keys(json).length == 0) {
12602
+ values = {};
12603
+ }
12604
+ else {
12605
+ const expanded = await jsonld.expand(json, {
12606
+ documentLoader: options.contextLoader,
12607
+ keepFreeFloatingNodes: true,
12608
+ });
12609
+ values =
12610
+ // deno-lint-ignore no-explicit-any
12611
+ (expanded[0] ?? {});
12612
+ }
12613
+ if ("@type" in values) {
12614
+ if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Offer")) {
12615
+ throw new TypeError("Invalid type: " + values["@type"]);
12616
+ }
12617
+ }
12618
+ const instance = await super.fromJsonLd(values, options);
12619
+ if (!(instance instanceof Offer)) {
12620
+ throw new TypeError("Unexpected type: " + instance.constructor.name);
12621
+ }
12622
+ return instance;
12623
+ }
12624
+ _getCustomInspectProxy() {
12625
+ const proxy = super._getCustomInspectProxy();
12626
+ return proxy;
12627
+ }
12628
+ [Symbol.for("Deno.customInspect")](inspect, options) {
12629
+ const proxy = this._getCustomInspectProxy();
12630
+ return "Offer " + inspect(proxy, options);
12631
+ }
12632
+ [Symbol.for("nodejs.util.inspect.custom")](_depth, options, inspect) {
12633
+ const proxy = this._getCustomInspectProxy();
12634
+ return "Offer " + inspect(proxy, options);
12635
+ }
12636
+ }
12508
12637
  /** A subtype of {@link Collection} in which members of the logical collection
12509
12638
  * are assumed to always be strictly ordered.
12510
12639
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/fedify",
3
- "version": "0.10.0",
3
+ "version": "0.11.0-dev.228+3d74617f",
4
4
  "description": "An ActivityPub server framework",
5
5
  "keywords": [
6
6
  "ActivityPub",
@@ -0,0 +1,3 @@
1
+ declare const preloadedContexts: Record<string, unknown>;
2
+ export default preloadedContexts;
3
+ //# sourceMappingURL=contexts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contexts.d.ts","sourceRoot":"","sources":["../../src/runtime/contexts.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAonB9C,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -47,6 +47,14 @@ export declare class FetchError extends Error {
47
47
  }
48
48
  /**
49
49
  * A JSON-LD document loader that utilizes the browser's `fetch` API.
50
+ *
51
+ * This loader preloads the below frequently used contexts:
52
+ *
53
+ * - <https://www.w3.org/ns/activitystreams>
54
+ * - <https://w3id.org/security/v1>
55
+ * - <https://w3id.org/security/data-integrity/v1>
56
+ * - <https://www.w3.org/ns/did/v1>
57
+ * - <https://w3id.org/security/multikey/v1>
50
58
  * @param url The URL of the document to load.
51
59
  * @returns The remote document.
52
60
  */
@@ -88,11 +96,7 @@ export interface KvCacheParameters {
88
96
  * a {@link URLPattern} and `duration` is a {@link Temporal.Duration}.
89
97
  * The `duration` is allowed to be at most 30 days.
90
98
  *
91
- * The default rules are:
92
- *
93
- * - `https://www.w3.org/ns/activitystreams` for 30 days
94
- * - `https://w3id.org/security/v1` for 30 days
95
- * - Everything else for 5 minutes
99
+ * By default, 5 minutes for all URLs.
96
100
  */
97
101
  rules?: [string | URL | dntShim.URLPattern, dntShim.Temporal.Duration][];
98
102
  }
@@ -1 +1 @@
1
- {"version":3,"file":"docloader.d.ts","sourceRoot":"","sources":["../../src/runtime/docloader.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAE5C,OAAO,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAM1D;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC;AAEtE;;;;;;;;GAQG;AACH,MAAM,MAAM,kCAAkC,GAAG,CAC/C,QAAQ,EAAE;IAAE,KAAK,EAAE,GAAG,CAAC;IAAC,UAAU,EAAE,OAAO,CAAC,SAAS,CAAA;CAA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function getActorClassByTypeName(typeName: ActorTypeName): typeof
35
35
  * ``` typescript
36
36
  * // Get the handle of an actor object:
37
37
  * await getActorHandle(
38
- * new Person({ id: new URL("https://todon.eu/users/hongminhee") })
38
+ * new Person({ id: new URL("https://fosstodon.org/users/hongminhee") })
39
39
  * );
40
40
  *
41
41
  * // Get the handle of an actor URI:
42
- * await getActorHandle(new URL("https://todon.eu/users/hongminhee"));
42
+ * await getActorHandle(new URL("https://fosstodon.org/users/hongminhee"));
43
43
  * ```
44
44
  *
45
45
  * @param actor The actor or actor URI to get the handle from.
@@ -24,15 +24,15 @@ export interface LookupObjectOptions {
24
24
  * @example
25
25
  * ``` typescript
26
26
  * // Look up an actor by its fediverse handle:
27
- * await lookupObject("@hongminhee@todon.eu");
27
+ * await lookupObject("@hongminhee@fosstodon.org");
28
28
  * // returning a `Person` object.
29
29
  *
30
30
  * // A fediverse handle can omit the leading '@':
31
- * await lookupObject("hongminhee@todon.eu");
31
+ * await lookupObject("hongminhee@fosstodon.org");
32
32
  * // returning a `Person` object.
33
33
  *
34
34
  * // A `acct:` URI can be used as well:
35
- * await lookupObject("acct:hongminhee@todon.eu");
35
+ * await lookupObject("acct:hongminhee@fosstodon.org");
36
36
  * // returning a `Person` object.
37
37
  *
38
38
  * // Look up an object by its URI:
@@ -5612,6 +5612,155 @@ export declare class Note extends Object {
5612
5612
  }): Promise<Note>;
5613
5613
  protected _getCustomInspectProxy(): Record<string, unknown>;
5614
5614
  }
5615
+ /** Indicates that the actor is offering the object.
5616
+ * If specified, the target indicates the entity to which
5617
+ * the object is being offered.
5618
+ */
5619
+ export declare class Offer extends Activity {
5620
+ /**
5621
+ * The type URI of {@link Offer}: `https://www.w3.org/ns/activitystreams#Offer`.
5622
+ */
5623
+ static get typeId(): URL;
5624
+ /**
5625
+ * Constructs a new instance of Offer with the given values.
5626
+ * @param values The values to initialize the instance with.
5627
+ * @param options The options to use for initialization.
5628
+ */
5629
+ constructor(values: {
5630
+ id?: URL | null;
5631
+ attachments?: (Object | Link | PropertyValue | URL)[];
5632
+ attribution?: Application | Group | Organization | Person | Service | URL | null;
5633
+ attributions?: (Application | Group | Organization | Person | Service | URL)[];
5634
+ audience?: Object | URL | null;
5635
+ audiences?: (Object | URL)[];
5636
+ content?: string | LanguageString | null;
5637
+ contents?: (string | LanguageString)[];
5638
+ contexts?: (Object | Link | URL)[];
5639
+ name?: string | LanguageString | null;
5640
+ names?: (string | LanguageString)[];
5641
+ endTime?: dntShim.Temporal.Instant | null;
5642
+ generators?: (Object | Link | URL)[];
5643
+ icon?: Image | URL | null;
5644
+ icons?: (Image | URL)[];
5645
+ image?: Image | URL | null;
5646
+ images?: (Image | URL)[];
5647
+ replyTarget?: Object | Link | URL | null;
5648
+ replyTargets?: (Object | Link | URL)[];
5649
+ location?: Object | Link | URL | null;
5650
+ locations?: (Object | Link | URL)[];
5651
+ preview?: Link | Object | URL | null;
5652
+ previews?: (Link | Object | URL)[];
5653
+ published?: dntShim.Temporal.Instant | null;
5654
+ replies?: Collection | URL | null;
5655
+ startTime?: dntShim.Temporal.Instant | null;
5656
+ summary?: string | LanguageString | null;
5657
+ summaries?: (string | LanguageString)[];
5658
+ tags?: (Object | Link | URL)[];
5659
+ updated?: dntShim.Temporal.Instant | null;
5660
+ url?: URL | Link | null;
5661
+ urls?: (URL | Link)[];
5662
+ to?: Object | URL | null;
5663
+ tos?: (Object | URL)[];
5664
+ bto?: Object | URL | null;
5665
+ btos?: (Object | URL)[];
5666
+ cc?: Object | URL | null;
5667
+ ccs?: (Object | URL)[];
5668
+ bcc?: Object | URL | null;
5669
+ bccs?: (Object | URL)[];
5670
+ mediaType?: string | null;
5671
+ duration?: dntShim.Temporal.Duration | null;
5672
+ sensitive?: boolean | null;
5673
+ proof?: DataIntegrityProof | URL | null;
5674
+ proofs?: (DataIntegrityProof | URL)[];
5675
+ actor?: Application | Group | Organization | Person | Service | URL | null;
5676
+ actors?: (Application | Group | Organization | Person | Service | URL)[];
5677
+ object?: Object | URL | null;
5678
+ objects?: (Object | URL)[];
5679
+ }, { documentLoader, contextLoader, }?: {
5680
+ documentLoader?: DocumentLoader;
5681
+ contextLoader?: DocumentLoader;
5682
+ });
5683
+ /**
5684
+ * Clones this instance, optionally updating it with the given values.
5685
+ * @param values The values to update the clone with.
5686
+ * @options The options to use for cloning.
5687
+ * @returns The cloned instance.
5688
+ */
5689
+ clone(values?: {
5690
+ id?: URL | null;
5691
+ attachments?: (Object | Link | PropertyValue | URL)[];
5692
+ attribution?: Application | Group | Organization | Person | Service | URL | null;
5693
+ attributions?: (Application | Group | Organization | Person | Service | URL)[];
5694
+ audience?: Object | URL | null;
5695
+ audiences?: (Object | URL)[];
5696
+ content?: string | LanguageString | null;
5697
+ contents?: (string | LanguageString)[];
5698
+ contexts?: (Object | Link | URL)[];
5699
+ name?: string | LanguageString | null;
5700
+ names?: (string | LanguageString)[];
5701
+ endTime?: dntShim.Temporal.Instant | null;
5702
+ generators?: (Object | Link | URL)[];
5703
+ icon?: Image | URL | null;
5704
+ icons?: (Image | URL)[];
5705
+ image?: Image | URL | null;
5706
+ images?: (Image | URL)[];
5707
+ replyTarget?: Object | Link | URL | null;
5708
+ replyTargets?: (Object | Link | URL)[];
5709
+ location?: Object | Link | URL | null;
5710
+ locations?: (Object | Link | URL)[];
5711
+ preview?: Link | Object | URL | null;
5712
+ previews?: (Link | Object | URL)[];
5713
+ published?: dntShim.Temporal.Instant | null;
5714
+ replies?: Collection | URL | null;
5715
+ startTime?: dntShim.Temporal.Instant | null;
5716
+ summary?: string | LanguageString | null;
5717
+ summaries?: (string | LanguageString)[];
5718
+ tags?: (Object | Link | URL)[];
5719
+ updated?: dntShim.Temporal.Instant | null;
5720
+ url?: URL | Link | null;
5721
+ urls?: (URL | Link)[];
5722
+ to?: Object | URL | null;
5723
+ tos?: (Object | URL)[];
5724
+ bto?: Object | URL | null;
5725
+ btos?: (Object | URL)[];
5726
+ cc?: Object | URL | null;
5727
+ ccs?: (Object | URL)[];
5728
+ bcc?: Object | URL | null;
5729
+ bccs?: (Object | URL)[];
5730
+ mediaType?: string | null;
5731
+ duration?: dntShim.Temporal.Duration | null;
5732
+ sensitive?: boolean | null;
5733
+ proof?: DataIntegrityProof | URL | null;
5734
+ proofs?: (DataIntegrityProof | URL)[];
5735
+ actor?: Application | Group | Organization | Person | Service | URL | null;
5736
+ actors?: (Application | Group | Organization | Person | Service | URL)[];
5737
+ object?: Object | URL | null;
5738
+ objects?: (Object | URL)[];
5739
+ }, options?: {
5740
+ documentLoader?: DocumentLoader;
5741
+ contextLoader?: DocumentLoader;
5742
+ }): Offer;
5743
+ /**
5744
+ * Converts this object to a JSON-LD structure.
5745
+ * @returns The JSON-LD representation of this object.
5746
+ */
5747
+ toJsonLd(options?: {
5748
+ expand?: boolean;
5749
+ contextLoader?: DocumentLoader;
5750
+ context?: string | Record<string, string> | (string | Record<string, string>)[];
5751
+ }): Promise<unknown>;
5752
+ /**
5753
+ * Converts a JSON-LD structure to an object of this type.
5754
+ * @param json The JSON-LD structure to convert.
5755
+ * @returns The object of this type.
5756
+ * @throws {TypeError} If the given `json` is invalid.
5757
+ */
5758
+ static fromJsonLd(json: unknown, options?: {
5759
+ documentLoader?: DocumentLoader;
5760
+ contextLoader?: DocumentLoader;
5761
+ }): Promise<Offer>;
5762
+ protected _getCustomInspectProxy(): Record<string, unknown>;
5763
+ }
5615
5764
  /** A subtype of {@link Collection} in which members of the logical collection
5616
5765
  * are assumed to always be strictly ordered.
5617
5766
  */