/** * #bundle.ts * * Code generated by ts-proto. DO NOT EDIT. * @packageDocumentation */ import type { Scope } from "../../reddit/devvit/app_permission/v1/app_permission.js"; import type { SerializableServiceDefinition } from "./serializable.js"; /** See also LinkedBundle. */ export declare enum LinkedBundleTargetPlatform { /** BROWSER - A LinkedBundle for browser runtimes. */ BROWSER = 0, /** V8 - A LinkedBundle for V8 runtimes. */ V8 = 1, /** * SKINNY - An API definition that cannot be executed. This is a LinkedBundle with no * code and no dependencies. */ SKINNY = 2, UNRECOGNIZED = -1 } export declare enum TargetRuntime { /** UNIVERSAL - Server-only as of 2025-06-04 or so. */ UNIVERSAL = 0, CLIENT = 1, UNRECOGNIZED = -1 } /** * Bundle or plugin configuration. This config is usually set by Config.init() * but some plugins may configure differently. */ export type ActorSpec = { /** * Bundle or plugin (PLUGIN_APP_NAME) name. This should be unique across app * actors. Usually just "main". */ name: string; /** Bundle or plugin (PLUGIN_OWNER) owner. Eg, "spez". */ owner: string; /** Bundle or plugin version. Eg, 1.2.3 or 1.2.3.0. */ version: string; }; /** Permitted and forbidden execution environments. */ export type LocationFilter = { allow: string[]; deny: string[]; }; export type Permissions = { /** List of fetch domains requested by the app. */ requestedFetchDomains: string[]; /** List of scopes that dictate what the app can run on behalf of the user. */ asUserScopes: Scope[]; }; /** * A provided implementation specified by a Bundle or plugin. See * Config.provides() and DependencySpec.provides. */ export type PackageSpec = { actor?: ActorSpec | undefined; /** The version provided. */ definition?: SerializableServiceDefinition | undefined; locations?: LocationFilter | undefined; partitionsBy: string[]; }; /** * A dependency use requirement specified by a Bundle or plugin. See * Config.use() and DependencySpec.uses. Dependencies may resolve to different * implementations in different execution environments. */ export type PackageQuery = { /** * Limit resolution to a Bundle or plugins (PLUGIN_APP_NAME). Eg, * com.devvit.example/foo. */ name?: string | undefined; /** Limit resolution to owner. Eg, com.reddit. */ owner?: string | undefined; /** * Limit resolution to type. No slashes. Eg, * "devvit.plugin.logger.Logger". See Definition.fullName. */ typeName: string; /** Limit resolution to versions. Eg, ">=0" or "1.0.0". */ versions?: string | undefined; }; /** Dependencies offered and required by a Bundle or plugin. See Config.export(). */ export type DependencySpec = { actor?: ActorSpec | undefined; /** * Actor hostname. This may be a plugin or a user actor. Eg, * "fd23937c-2891-44ed-a66c-5277265cfd54.pixelary-game.main.devvit-gateway.reddit.com": * * | Prisma Installation.id | devvit.yaml app name / slug | ActorSpec.name | | * | ------------------------------------ | --------------------------- | -------------- | ------------------------- | * | fd23937c-2891-44ed-a66c-5277265cfd54 | pixelary-game | main | devvit-gateway.reddit.com | * * Which corresponds to the V8 LinkedBundle at * https://devvit-gateway.reddit.com/bundles/fd23937c-2891-44ed-a66c-5277265cfd54/main/0.0.8-359. * * Multi-actor apps are deprecated so app name is usually what's most * important. Plugins are simpler. Eg, "http.plugins.local". */ hostname: string; provides: PackageSpec[]; uses: PackageQuery[]; permissions: Permissions[]; }; /** * A fully built actor (either a user app or plugin). This resolved Bundle is * ready for execution by the runtime. */ export type LinkedBundle = { actor?: ActorSpec | undefined; /** * Compiled bundle or plugin code. A hostname and empty code implies that the * runtime should resolve this as a remote actor accessible over the network; * this is empty for "skinny bundles" (AKA Gateway bundles). */ code: string; /** * Source map accompanying code. This should be a JSON string containing the * source map bundle accompanying the code. Not required. */ sourceMap?: string | undefined; /** * Actor hostname. This may be a plugin or a user. See DependencySpec.hostname * which Community Portal copies here. */ hostname: string; provides: SerializableServiceDefinition[]; /** * True dependencies. This is empty for skinny bundles which describe the * input / output API only. They have no code and cannot be executed so their * dependencies are not needed. */ uses: LinkedBundle[]; /** * Optional information about the environment the code was built in. Outdated * dependencies may indicate an invalid build. */ buildInfo?: BuildInfo | undefined; /** * Where did the uploaded ./assets folder land? This is a URL to the FileSystem * as JSON that contains the assets. * * @deprecated */ assetsUrl?: string | undefined; /** * This map is used to resolve relative asset paths to URLs. The key * is the path to the asset, and the value is the URL to the asset. * e.g. `"images/example.png": "https://i.redd.it/example.png"`. May include * the app icon as `$devvit_icon.png`. */ assets: { [key: string]: string; }; /** * This map is used to resolve assets for the webview block. These are uploaded * to S3 and servable as static contents from CDN. * * For historical reasons, the key is the developer's local asset path (e.g. "images/example.png"), * and the value is `/`, e.g. "fd23937c-2891-44ed-a66c-5277265cfd54/images/example.png". * These should all be served from the webview domain at the asset path (e.g. "GET /images/example.png"). */ webviewAssets: { [key: string]: string; }; /** This map is used to resolve a sku to a UUID used by the Payment platform to identify the product */ products: { [key: string]: string; }; /** * Standalone server implementation, without Blocks rendering or "Devvit Classic". * If provided, this code is expected to be an entry point for an HTTP server that can * handle requests at process.env.WEBBIT_PORT. Present in server (UNIVERSAL) * bundles only. */ server?: ServerBundle | undefined; }; export type LinkedBundle_AssetsEntry = { key: string; value: string; }; export type LinkedBundle_WebviewAssetsEntry = { key: string; value: string; }; export type LinkedBundle_ProductsEntry = { key: string; value: string; }; /** * This represents a standalone server implementation that starts an HTTP server * to execute on Devvit's compute platform. */ export type ServerBundle = { /** * A compiled bundle of code to be executed as-is. Listening on the server port * for HTTP requests should occur through side effects of evaluating this code. */ code: string; /** * Source map accompanying |code|, used for better stack traces when erorrs occur. * Not required. For specification, see: https://tc39.es/ecma426/ */ sourceMap: string; }; /** Detail about the tooling used to construct a LinkedBundle. */ export type BuildInfo = { /** When the LinkedBundle was built. */ created?: string | undefined; /** * Notable package.json versions recorded at build time. Eg: * * @devvit/protos → 1.2.3 * @devvit/public-api → 4.5.6 * node → 7.8.9 */ dependencies: { [key: string]: string; }; /** Where the bundle can be executed */ targetRuntime: TargetRuntime; }; export type BuildInfo_DependenciesEntry = { key: string; value: string; }; //# sourceMappingURL=bundle.d.ts.map