@devvit/public-api 0.10.23-next-2024-06-12-b0284ca60.0 → 0.10.23-next-2024-06-12-1b25bb8f2.0

Sign up to get free protection for your applications and to get access to all the features.
package/public-api.d.ts CHANGED
@@ -1447,15 +1447,18 @@ declare class AssetsClient {
1447
1447
  /**
1448
1448
  * Gets the public URLs for an asset.
1449
1449
  * @param assetPath A path, relative to the 'assets/' folder.
1450
+ * @param options
1450
1451
  * @returns The public URL for that asset (https://i.redd.it/<id>.<ext>)
1451
1452
  */
1452
1453
  getURL(assetPath: string): string;
1454
+ getURL(assetPath: string, options: GetURLOptions | undefined): string;
1453
1455
  /**
1454
1456
  * Gets the public URLs for multiple assets.
1455
1457
  * @param assetPaths An array of paths, relative to the 'assets/' folder.
1456
1458
  * @returns A map of each asset path to its public URL (https://i.redd.it/<id>.<ext>)
1457
1459
  */
1458
1460
  getURL(assetPaths: string[]): AssetMap;
1461
+ getURL(assetPaths: string[], options: GetURLOptions | undefined): AssetMap;
1459
1462
  }
1460
1463
 
1461
1464
  export declare type AsyncError = {
@@ -2864,6 +2867,9 @@ declare const BootstrapActorDefinition: {
2864
2867
  assets?: {
2865
2868
  [x: string]: string | undefined;
2866
2869
  };
2870
+ webviewAssets?: {
2871
+ [x: string]: string | undefined;
2872
+ };
2867
2873
  } | undefined): LinkedBundle;
2868
2874
  fromPartial(object: {
2869
2875
  actor?: {
@@ -2897,6 +2903,9 @@ declare const BootstrapActorDefinition: {
2897
2903
  assets?: {
2898
2904
  [x: string]: string | undefined;
2899
2905
  };
2906
+ webviewAssets?: {
2907
+ [x: string]: string | undefined;
2908
+ };
2900
2909
  }): LinkedBundle;
2901
2910
  };
2902
2911
  readonly requestStream: false;
@@ -3338,6 +3347,9 @@ declare const BuildPackDefinition: {
3338
3347
  assetIds?: {
3339
3348
  [x: string]: string | undefined;
3340
3349
  };
3350
+ webviewAssetIds?: {
3351
+ [x: string]: string | undefined;
3352
+ };
3341
3353
  } | undefined;
3342
3354
  errors?: {
3343
3355
  detail?: {
@@ -3419,6 +3431,9 @@ declare const BuildPackDefinition: {
3419
3431
  assetIds?: {
3420
3432
  [x: string]: string | undefined;
3421
3433
  };
3434
+ webviewAssetIds?: {
3435
+ [x: string]: string | undefined;
3436
+ };
3422
3437
  } | undefined;
3423
3438
  errors?: {
3424
3439
  detail?: {
@@ -3557,6 +3572,9 @@ declare const BuildPackDefinition: {
3557
3572
  assetIds?: {
3558
3573
  [x: string]: string | undefined;
3559
3574
  };
3575
+ webviewAssetIds?: {
3576
+ [x: string]: string | undefined;
3577
+ };
3560
3578
  } | undefined;
3561
3579
  errors?: {
3562
3580
  detail?: {
@@ -3638,6 +3656,9 @@ declare const BuildPackDefinition: {
3638
3656
  assetIds?: {
3639
3657
  [x: string]: string | undefined;
3640
3658
  };
3659
+ webviewAssetIds?: {
3660
+ [x: string]: string | undefined;
3661
+ };
3641
3662
  } | undefined;
3642
3663
  errors?: {
3643
3664
  detail?: {
@@ -3978,6 +3999,14 @@ declare interface Bundle {
3978
3999
  assetIds: {
3979
4000
  [key: string]: string;
3980
4001
  };
4002
+ /**
4003
+ * This map contains html assets from the webroot directory for use in a webview.
4004
+ * It has the same structure as asset_ids but is rooted in the webroot directory
4005
+ * and is isolated from regular assets.
4006
+ */
4007
+ webviewAssetIds: {
4008
+ [key: string]: string;
4009
+ };
3981
4010
  }
3982
4011
 
3983
4012
  declare const Bundle: {
@@ -4005,6 +4034,21 @@ declare const Bundle_AssetIdsEntry: {
4005
4034
  fromPartial(object: DeepPartial_23<Bundle_AssetIdsEntry>): Bundle_AssetIdsEntry;
4006
4035
  };
4007
4036
 
4037
+ declare interface Bundle_WebviewAssetIdsEntry {
4038
+ key: string;
4039
+ value: string;
4040
+ }
4041
+
4042
+ declare const Bundle_WebviewAssetIdsEntry: {
4043
+ $type: "devvit.plugin.buildpack.Bundle.WebviewAssetIdsEntry";
4044
+ encode(message: Bundle_WebviewAssetIdsEntry, writer?: _m0.Writer): _m0.Writer;
4045
+ decode(input: _m0.Reader | Uint8Array, length?: number): Bundle_WebviewAssetIdsEntry;
4046
+ fromJSON(object: any): Bundle_WebviewAssetIdsEntry;
4047
+ toJSON(message: Bundle_WebviewAssetIdsEntry): unknown;
4048
+ create(base?: DeepPartial_23<Bundle_WebviewAssetIdsEntry>): Bundle_WebviewAssetIdsEntry;
4049
+ fromPartial(object: DeepPartial_23<Bundle_WebviewAssetIdsEntry>): Bundle_WebviewAssetIdsEntry;
4050
+ };
4051
+
4008
4052
  /** Fetch a bundle by its hostname */
4009
4053
  declare interface BundleRequest {
4010
4054
  /** Must be legal name for filesystem. Eg, LinkedBundle.hostname. 'main.local' */
@@ -4085,6 +4129,9 @@ declare const BundleServiceDefinition: {
4085
4129
  assets?: {
4086
4130
  [x: string]: string | undefined;
4087
4131
  };
4132
+ webviewAssets?: {
4133
+ [x: string]: string | undefined;
4134
+ };
4088
4135
  } | undefined): LinkedBundle;
4089
4136
  fromPartial(object: {
4090
4137
  actor?: {
@@ -4118,6 +4165,9 @@ declare const BundleServiceDefinition: {
4118
4165
  assets?: {
4119
4166
  [x: string]: string | undefined;
4120
4167
  };
4168
+ webviewAssets?: {
4169
+ [x: string]: string | undefined;
4170
+ };
4121
4171
  }): LinkedBundle;
4122
4172
  };
4123
4173
  readonly requestStream: false;
@@ -4184,6 +4234,9 @@ declare const BundleServiceDefinition: {
4184
4234
  assets?: {
4185
4235
  [x: string]: string | undefined;
4186
4236
  };
4237
+ webviewAssets?: {
4238
+ [x: string]: string | undefined;
4239
+ };
4187
4240
  } | undefined): LinkedBundle;
4188
4241
  fromPartial(object: {
4189
4242
  actor?: {
@@ -4217,6 +4270,9 @@ declare const BundleServiceDefinition: {
4217
4270
  assets?: {
4218
4271
  [x: string]: string | undefined;
4219
4272
  };
4273
+ webviewAssets?: {
4274
+ [x: string]: string | undefined;
4275
+ };
4220
4276
  }): LinkedBundle;
4221
4277
  };
4222
4278
  readonly responseStream: false;
@@ -5334,6 +5390,7 @@ declare const ComposeRequest: {
5334
5390
  declare type Config = {
5335
5391
  readonly assets: Readonly<AssetMap>;
5336
5392
  readonly providedDefinitions: Readonly<Definition>[];
5393
+ readonly webviewAssets?: Readonly<AssetMap> | undefined;
5337
5394
  export(namespace: Readonly<Namespace>): DependencySpec;
5338
5395
  provides(definition: Readonly<Definition>): void;
5339
5396
  use<T>(definition: Readonly<Definition>, options?: Readonly<DeepPartial_15<PackageQuery>>): T;
@@ -13857,6 +13914,8 @@ declare const GetActionsResponse: {
13857
13914
  declare interface GetAssetURLRequest {
13858
13915
  /** The path to the asset relative to the /assets directory of the project */
13859
13916
  path: string;
13917
+ /** If true, look for a webview asset instead of a standard asset */
13918
+ webview?: boolean | undefined;
13860
13919
  }
13861
13920
 
13862
13921
  declare const GetAssetURLRequest: {
@@ -14674,6 +14733,10 @@ export declare type GetSubredditUsersByTypeOptions = ListingFetchOptions & {
14674
14733
 
14675
14734
  declare type GetSubredditUsersOptions = Omit<GetSubredditUsersByTypeOptions, 'type'>;
14676
14735
 
14736
+ declare type GetURLOptions = {
14737
+ webview?: boolean | undefined;
14738
+ };
14739
+
14677
14740
  export declare type GetUserFlairBySubredditOptions = UserFlairPageOptions & {
14678
14741
  /** The subreddit associated with the flair being retrieved. */
14679
14742
  subreddit: string;
@@ -17225,6 +17288,13 @@ declare interface LinkedBundle {
17225
17288
  assets: {
17226
17289
  [key: string]: string;
17227
17290
  };
17291
+ /**
17292
+ * This map is used to resolve assets for the webview block. It will only
17293
+ * contain references to the html files in the webroot assets directory.
17294
+ */
17295
+ webviewAssets: {
17296
+ [key: string]: string;
17297
+ };
17228
17298
  }
17229
17299
 
17230
17300
  declare const LinkedBundle: {
@@ -17252,6 +17322,21 @@ declare const LinkedBundle_AssetsEntry: {
17252
17322
  fromPartial(object: DeepPartial_14<LinkedBundle_AssetsEntry>): LinkedBundle_AssetsEntry;
17253
17323
  };
17254
17324
 
17325
+ declare interface LinkedBundle_WebviewAssetsEntry {
17326
+ key: string;
17327
+ value: string;
17328
+ }
17329
+
17330
+ declare const LinkedBundle_WebviewAssetsEntry: {
17331
+ $type: "devvit.runtime.LinkedBundle.WebviewAssetsEntry";
17332
+ encode(message: LinkedBundle_WebviewAssetsEntry, writer?: _m0.Writer): _m0.Writer;
17333
+ decode(input: _m0.Reader | Uint8Array, length?: number): LinkedBundle_WebviewAssetsEntry;
17334
+ fromJSON(object: any): LinkedBundle_WebviewAssetsEntry;
17335
+ toJSON(message: LinkedBundle_WebviewAssetsEntry): unknown;
17336
+ create(base?: DeepPartial_14<LinkedBundle_WebviewAssetsEntry>): LinkedBundle_WebviewAssetsEntry;
17337
+ fromPartial(object: DeepPartial_14<LinkedBundle_WebviewAssetsEntry>): LinkedBundle_WebviewAssetsEntry;
17338
+ };
17339
+
17255
17340
  /** See also LinkedBundle. */
17256
17341
  declare enum LinkedBundleTargetPlatform {
17257
17342
  /** BROWSER - A LinkedBundle for browser runtimes. */
@@ -17371,6 +17456,9 @@ declare const LinkerDefinition: {
17371
17456
  assetIds?: {
17372
17457
  [x: string]: string | undefined;
17373
17458
  };
17459
+ webviewAssetIds?: {
17460
+ [x: string]: string | undefined;
17461
+ };
17374
17462
  } | undefined): Bundle;
17375
17463
  fromPartial(object: {
17376
17464
  code?: string;
@@ -17430,6 +17518,9 @@ declare const LinkerDefinition: {
17430
17518
  assetIds?: {
17431
17519
  [x: string]: string | undefined;
17432
17520
  };
17521
+ webviewAssetIds?: {
17522
+ [x: string]: string | undefined;
17523
+ };
17433
17524
  }): Bundle;
17434
17525
  };
17435
17526
  readonly requestStream: false;
@@ -41356,6 +41447,7 @@ declare namespace protos {
41356
41447
  DependencySpec,
41357
41448
  LinkedBundle,
41358
41449
  LinkedBundle_AssetsEntry,
41450
+ LinkedBundle_WebviewAssetsEntry,
41359
41451
  BuildInfo,
41360
41452
  BuildInfo_DependenciesEntry,
41361
41453
  RemoteLogPublisherClient,
@@ -41660,6 +41752,7 @@ declare namespace protos {
41660
41752
  Minify,
41661
41753
  Bundle,
41662
41754
  Bundle_AssetIdsEntry,
41755
+ Bundle_WebviewAssetIdsEntry,
41663
41756
  CompileParams,
41664
41757
  CompileLog,
41665
41758
  CompileLogLineDetail,
@@ -46830,6 +46923,9 @@ declare const ResolverDefinition: {
46830
46923
  assetIds?: {
46831
46924
  [x: string]: string | undefined;
46832
46925
  };
46926
+ webviewAssetIds?: {
46927
+ [x: string]: string | undefined;
46928
+ };
46833
46929
  } | undefined): Bundle;
46834
46930
  fromPartial(object: {
46835
46931
  code?: string;
@@ -46889,6 +46985,9 @@ declare const ResolverDefinition: {
46889
46985
  assetIds?: {
46890
46986
  [x: string]: string | undefined;
46891
46987
  };
46988
+ webviewAssetIds?: {
46989
+ [x: string]: string | undefined;
46990
+ };
46892
46991
  }): Bundle;
46893
46992
  };
46894
46993
  readonly requestStream: false;
@@ -47359,6 +47458,9 @@ declare const RuntimeActorDefinition: {
47359
47458
  assets?: {
47360
47459
  [x: string]: string | undefined;
47361
47460
  };
47461
+ webviewAssets?: {
47462
+ [x: string]: string | undefined;
47463
+ };
47362
47464
  } | undefined): LinkedBundle;
47363
47465
  fromPartial(object: {
47364
47466
  actor?: {
@@ -47392,6 +47494,9 @@ declare const RuntimeActorDefinition: {
47392
47494
  assets?: {
47393
47495
  [x: string]: string | undefined;
47394
47496
  };
47497
+ webviewAssets?: {
47498
+ [x: string]: string | undefined;
47499
+ };
47395
47500
  }): LinkedBundle;
47396
47501
  };
47397
47502
  readonly requestStream: false;
@@ -50698,6 +50803,9 @@ declare const SubredditMetadataResolverDefinition: {
50698
50803
  assets?: {
50699
50804
  [x: string]: string | undefined;
50700
50805
  };
50806
+ webviewAssets?: {
50807
+ [x: string]: string | undefined;
50808
+ };
50701
50809
  }[];
50702
50810
  contextActions?: {
50703
50811
  actorHostname?: string;
@@ -50771,6 +50879,9 @@ declare const SubredditMetadataResolverDefinition: {
50771
50879
  assets?: {
50772
50880
  [x: string]: string | undefined;
50773
50881
  };
50882
+ webviewAssets?: {
50883
+ [x: string]: string | undefined;
50884
+ };
50774
50885
  }[];
50775
50886
  contextActions?: {
50776
50887
  actorHostname?: string;
@@ -55698,6 +55809,9 @@ declare const SupervisorDefinition: {
55698
55809
  assets?: {
55699
55810
  [x: string]: string | undefined;
55700
55811
  };
55812
+ webviewAssets?: {
55813
+ [x: string]: string | undefined;
55814
+ };
55701
55815
  } | undefined): LinkedBundle;
55702
55816
  fromPartial(object: {
55703
55817
  actor?: {
@@ -55731,6 +55845,9 @@ declare const SupervisorDefinition: {
55731
55845
  assets?: {
55732
55846
  [x: string]: string | undefined;
55733
55847
  };
55848
+ webviewAssets?: {
55849
+ [x: string]: string | undefined;
55850
+ };
55734
55851
  }): LinkedBundle;
55735
55852
  };
55736
55853
  readonly requestStream: false;