@wp-playground/client 0.6.13 → 0.6.15

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.
Files changed (4) hide show
  1. package/index.cjs +16 -16
  2. package/index.d.ts +27 -11
  3. package/index.js +830 -810
  4. package/package.json +3 -3
package/index.d.ts CHANGED
@@ -1172,16 +1172,9 @@ export interface ActivatePluginStep {
1172
1172
  */
1173
1173
  export declare const activatePlugin: StepHandler<ActivatePluginStep>;
1174
1174
  /**
1175
- * @inheritDoc defineSiteUrl
1176
- * @hasRunnableExample
1177
- * @example
1175
+ * Changes the site URL of the WordPress installation.
1178
1176
  *
1179
- * <code>
1180
- * {
1181
- * "step": "defineSiteUrl",
1182
- * "siteUrl": "https://playground.wordpress.net"
1183
- * }
1184
- * </code>
1177
+ * @inheritDoc defineSiteUrl
1185
1178
  */
1186
1179
  export interface DefineSiteUrlStep {
1187
1180
  step: "defineSiteUrl";
@@ -1191,10 +1184,33 @@ export interface DefineSiteUrlStep {
1191
1184
  /**
1192
1185
  * Sets WP_HOME and WP_SITEURL constants for the WordPress installation.
1193
1186
  *
1187
+ * Beware: Using this step makes no sense on playground.wordpress.net.
1188
+ * It is useful when you're building a custom Playground-based tool like wp-now,
1189
+ * or deploying Playground on a custom domain.
1190
+ *
1194
1191
  * @param playground The playground client.
1195
1192
  * @param siteUrl
1196
1193
  */
1197
1194
  export declare const defineSiteUrl: StepHandler<DefineSiteUrlStep>;
1195
+ export interface InstallAssetOptions {
1196
+ /**
1197
+ * The zip file to install.
1198
+ */
1199
+ zipFile: File;
1200
+ /**
1201
+ * Target path to extract the main folder.
1202
+ * @example
1203
+ *
1204
+ * <code>
1205
+ * const targetPath = `${await playground.documentRoot}/wp-content/plugins`;
1206
+ * </code>
1207
+ */
1208
+ targetPath: string;
1209
+ /**
1210
+ * What to do if the asset already exists.
1211
+ */
1212
+ ifAlreadyInstalled?: "overwrite" | "skip" | "error";
1213
+ }
1198
1214
  /**
1199
1215
  * @inheritDoc installPlugin
1200
1216
  * @hasRunnableExample
@@ -1215,7 +1231,7 @@ export declare const defineSiteUrl: StepHandler<DefineSiteUrlStep>;
1215
1231
  * }
1216
1232
  * </code>
1217
1233
  */
1218
- export interface InstallPluginStep<ResourceType> {
1234
+ export interface InstallPluginStep<ResourceType> extends Pick<InstallAssetOptions, "ifAlreadyInstalled"> {
1219
1235
  /**
1220
1236
  * The step identifier.
1221
1237
  */
@@ -1262,7 +1278,7 @@ export declare const installPlugin: StepHandler<InstallPluginStep<File>>;
1262
1278
  * }
1263
1279
  * </code>
1264
1280
  */
1265
- export interface InstallThemeStep<ResourceType> {
1281
+ export interface InstallThemeStep<ResourceType> extends Pick<InstallAssetOptions, "ifAlreadyInstalled"> {
1266
1282
  /**
1267
1283
  * The step identifier.
1268
1284
  */