[{"data":1,"prerenderedAt":684},["ShallowReactive",2],{"page:\u002Fextensions\u002Fericlm\u002Fkubb-plugin-playwright\u002Foptions":3},{"id":4,"frontmatter":5,"title":6,"heading":6,"body":7,"path":683,"source":4},"extensions\u002Fericlm\u002Fkubb-plugin-playwright\u002Foptions.md",{},"Options",{"type":8,"value":9,"toc":672},"minimark",[10,25,30,212,232,251,255,259,262,294,354,365,378,380,398,427,445,651,661],[11,12,13,14,18,19,24],"p",{},"Pass these options to ",[15,16,17],"code",{},"pluginPlaywright()",". All of them are optional, and shared options link to ",[20,21,23],"a",{"href":22},"https:\u002F\u002Fkubb.dev\u002Fdocs\u002F5.x\u002Freference\u002Fplugin-options","Shared plugin options",".",[26,27,29],"h2",{"id":28},"options-overview","Options overview",[31,32,33,49],"table",{},[34,35,36],"thead",{},[37,38,39,43,46],"tr",{},[40,41,42],"th",{},"Option",[40,44,45],{},"Purpose",[40,47,48],{},"Default",[50,51,52,87,109,124,140,160,177,195],"tbody",{},[37,53,54,63,82],{},[55,56,57],"td",{},[20,58,60],{"href":59},"https:\u002F\u002Fkubb.dev\u002Fdocs\u002F5.x\u002Freference\u002Fplugin-options#output",[15,61,62],{},"output",[55,64,65,66,69,70,69,73,69,76,69,79,24],{},"Where files are written: ",[15,67,68],{},"path",", ",[15,71,72],{},"mode",[15,74,75],{},"barrel",[15,77,78],{},"banner",[15,80,81],{},"footer",[55,83,84],{},[15,85,86],{},"{ path: 'playwright', barrel: { type: 'named' } }",[37,88,89,97,106],{},[55,90,91],{},[20,92,94],{"href":93},"https:\u002F\u002Fkubb.dev\u002Fdocs\u002F5.x\u002Freference\u002Fplugin-options#group",[15,95,96],{},"group",[55,98,99,100,69,103,24],{},"Split output by tag or path: ",[15,101,102],{},"type",[15,104,105],{},"name",[55,107,108],{},"None",[37,110,111,119,122],{},[55,112,113],{},[20,114,116],{"href":115},"#baseurl",[15,117,118],{},"baseURL",[55,120,121],{},"URL prefix written into every generated request.",[55,123,108],{},[37,125,126,134,137],{},[55,127,128],{},[20,129,131],{"href":130},"https:\u002F\u002Fkubb.dev\u002Fdocs\u002F5.x\u002Freference\u002Fplugin-options#include",[15,132,133],{},"include",[55,135,136],{},"Keep only operations that match.",[55,138,139],{},"All supported operations",[37,141,142,150,155],{},[55,143,144],{},[20,145,147],{"href":146},"https:\u002F\u002Fkubb.dev\u002Fdocs\u002F5.x\u002Freference\u002Fplugin-options#exclude",[15,148,149],{},"exclude",[55,151,152,153,24],{},"Skip operations that match. Exclusion wins over ",[15,154,133],{},[55,156,157],{},[15,158,159],{},"[]",[37,161,162,170,173],{},[55,163,164],{},[20,165,167],{"href":166},"https:\u002F\u002Fkubb.dev\u002Fdocs\u002F5.x\u002Freference\u002Fplugin-options#override",[15,168,169],{},"override",[55,171,172],{},"Apply different options per pattern.",[55,174,175],{},[15,176,159],{},[37,178,179,187,190],{},[55,180,181],{},[20,182,184],{"href":183},"#resolver",[15,185,186],{},"resolver",[55,188,189],{},"Customize generated names and file paths.",[55,191,192],{},[15,193,194],{},"resolverPlaywright",[37,196,197,205,208],{},[55,198,199],{},[20,200,202],{"href":201},"https:\u002F\u002Fkubb.dev\u002Fdocs\u002F5.x\u002Freference\u002Fplugin-options#macros",[15,203,204],{},"macros",[55,206,207],{},"Rewrite operation nodes before printing, in order.",[55,209,210],{},[15,211,159],{},[11,213,214,215,217,218,221,222,224,225,227,228,231],{},"A custom ",[15,216,62],{}," replaces the default object, so add ",[15,219,220],{},"barrel: { type: 'named' }"," to keep named exports. When an ",[15,223,169],{}," sets ",[15,226,62],{},", also set ",[15,229,230],{},"output.mode",", because Kubb does not infer it again.",[11,233,234,69,236,239,240,243,244,247,248,24],{},[15,235,6],{},[15,237,238],{},"PluginPlaywright",", and ",[15,241,242],{},"ResolverPlaywright"," are exported by ",[15,245,246],{},"kubb-plugin-playwright",". The shared option types come from ",[15,249,250],{},"@kubb\u002Fkit",[26,252,254],{"id":253},"option-details","Option details",[256,257,118],"h3",{"id":258},"baseurl",[11,260,261],{},"Prepends a URL to each operation path. Trailing slashes are removed before joining.",[31,263,264,272],{},[34,265,266],{},[37,267,268,270],{},[40,269],{},[40,271],{},[50,273,274,284],{},[37,275,276,279],{},[55,277,278],{},"Type",[55,280,281],{},[15,282,283],{},"string",[37,285,286,289],{},[55,287,288],{},"Required",[55,290,291],{},[15,292,293],{},"false",[295,296,301],"pre",{"language":297,"filename":298,"code":299,"class":300},"typescript","kubb.config.ts","import { pluginPlaywright } from 'kubb-plugin-playwright'\n\npluginPlaywright({ baseURL: 'https:\u002F\u002Fapi.example.com\u002Fv1' })","highlights",[15,302,304,331,332,331,334],{"class":303},"language-typescript",[305,306,309,313,317,321,324,327],"span",{"class":307,"style":308},"line","display: inline",[305,310,312],{"style":311},"color:#d73a49;--hls-dark:#f97583","import ",[305,314,316],{"style":315},"color:#005cc5;--hls-dark:#79b8ff","{ ",[305,318,320],{"style":319},"color:#24292e;--hls-dark:#e1e4e8","pluginPlaywright ",[305,322,323],{"style":315},"} ",[305,325,326],{"style":311},"from ",[305,328,330],{"style":329},"color:#032f62;--hls-dark:#9ecbff","'kubb-plugin-playwright'","\n",[305,333],{"class":307,"style":308},[305,335,336,340,343,345,348,351],{"class":307,"style":308},[305,337,339],{"style":338},"color:#6f42c1;--hls-dark:#b392f0","pluginPlaywright",[305,341,342],{"style":315},"({ ",[305,344,118],{"style":315},[305,346,347],{"style":311},": ",[305,349,350],{"style":329},"'https:\u002F\u002Fapi.example.com\u002Fv1' ",[305,352,353],{"style":315},"})",[11,355,356,357,360,361,364],{},"The URL for ",[15,358,359],{},"\u002Fpets\u002F{petId}"," becomes ",[15,362,363],{},"https:\u002F\u002Fapi.example.com\u002Fv1\u002Fpets\u002F"," followed by the encoded ID. The URL is part of the generated code.",[11,366,367,368,370,371,374,375,377],{},"When omitted, helpers use the relative operation path, and Playwright resolves it against the request context ",[15,369,118],{},". OpenAPI ",[15,372,373],{},"servers"," are ignored. Leave ",[15,376,118],{}," unset to pick the environment when you create the context.",[256,379,186],{"id":186},[11,381,382,383,386,387,390,391,394,395,24],{},"The default resolver prefixes helper names and file names with ",[15,384,385],{},"pw",", starting from the operation ID. For ",[15,388,389],{},"getPetById",", the function and its export are ",[15,392,393],{},"pwGetPetById",", in ",[15,396,397],{},"pwGetPetById.ts",[31,399,400,408],{},[34,401,402],{},[37,403,404,406],{},[40,405],{},[40,407],{},[50,409,410,419],{},[37,411,412,414],{},[55,413,278],{},[55,415,416],{},[15,417,418],{},"ResolverPatch\u003CResolverPlaywright>",[37,420,421,423],{},[55,422,288],{},[55,424,425],{},[15,426,293],{},[11,428,429,430,432,433,436,437,440,441,444],{},"Override ",[15,431,105],{}," and ",[15,434,435],{},"file.baseName"," together to change the prefix of both functions and files. This example reuses the default casing and produces ",[15,438,439],{},"apiGetPetById"," in ",[15,442,443],{},"apiGetPetById.ts",":",[295,446,448],{"language":297,"filename":298,"code":447,"class":300},"import { pluginPlaywright, resolverPlaywright } from 'kubb-plugin-playwright'\n\nfunction resolveName(operationId: string) {\n  return resolverPlaywright.name(operationId).replace(\u002F^pw\u002F, 'api')\n}\n\npluginPlaywright({\n  resolver: {\n    name: resolveName,\n    file: {\n      baseName: ({ name, extname }) => `${resolveName(name)}${extname}`,\n    },\n  },\n})",[15,449,450,331,469,331,471,331,492,331,530,331,535,331,537,331,544,331,555,331,569,331,580,331,631,331,639,331,647],{"class":303},[305,451,452,454,456,458,460,463,465,467],{"class":307,"style":308},[305,453,312],{"style":311},[305,455,316],{"style":315},[305,457,339],{"style":319},[305,459,69],{"style":311},[305,461,462],{"style":319},"resolverPlaywright ",[305,464,323],{"style":315},[305,466,326],{"style":311},[305,468,330],{"style":329},[305,470],{"class":307,"style":308},[305,472,473,476,479,482,485,487,489],{"class":307,"style":308},[305,474,475],{"style":311},"function ",[305,477,478],{"style":338},"resolveName",[305,480,481],{"style":315},"(",[305,483,484],{"style":319},"operationId",[305,486,347],{"style":319},[305,488,283],{"style":338},[305,490,491],{"style":315},") {",[305,493,494,497,500,502,504,506,508,510,513,515,518,520,523,525,528],{"class":307,"style":308},[305,495,496],{"style":315},"  ",[305,498,499],{"style":311},"return ",[305,501,194],{"style":319},[305,503,24],{"style":311},[305,505,105],{"style":338},[305,507,481],{"style":315},[305,509,484],{"style":319},[305,511,512],{"style":315},")",[305,514,24],{"style":311},[305,516,517],{"style":338},"replace",[305,519,481],{"style":315},[305,521,522],{"style":329},"\u002F^pw\u002F",[305,524,69],{"style":311},[305,526,527],{"style":329},"'api'",[305,529,512],{"style":315},[305,531,532],{"class":307,"style":308},[305,533,534],{"style":315},"}",[305,536],{"class":307,"style":308},[305,538,539,541],{"class":307,"style":308},[305,540,339],{"style":338},[305,542,543],{"style":315},"({",[305,545,546,548,550,552],{"class":307,"style":308},[305,547,496],{"style":315},[305,549,186],{"style":315},[305,551,347],{"style":311},[305,553,554],{"style":315},"{",[305,556,557,560,562,564,566],{"class":307,"style":308},[305,558,559],{"style":315},"    ",[305,561,105],{"style":315},[305,563,347],{"style":311},[305,565,478],{"style":319},[305,567,568],{"style":311},",",[305,570,571,573,576,578],{"class":307,"style":308},[305,572,559],{"style":311},[305,574,575],{"style":315},"file",[305,577,347],{"style":311},[305,579,554],{"style":315},[305,581,582,585,588,590,592,594,596,599,602,605,608,611,613,615,617,619,622,625,627,629],{"class":307,"style":308},[305,583,584],{"style":315},"      ",[305,586,587],{"style":315},"baseName",[305,589,347],{"style":311},[305,591,342],{"style":315},[305,593,105],{"style":319},[305,595,69],{"style":311},[305,597,598],{"style":319},"extname ",[305,600,601],{"style":315},"}) ",[305,603,604],{"style":311},"=> ",[305,606,607],{"style":329},"`",[305,609,610],{"style":319},"${",[305,612,478],{"style":338},[305,614,481],{"style":315},[305,616,105],{"style":319},[305,618,512],{"style":315},[305,620,621],{"style":319},"}${",[305,623,624],{"style":319},"extname",[305,626,534],{"style":319},[305,628,607],{"style":329},[305,630,568],{"style":311},[305,632,633,635,637],{"class":307,"style":308},[305,634,559],{"style":311},[305,636,534],{"style":315},[305,638,568],{"style":311},[305,640,641,643,645],{"class":307,"style":308},[305,642,496],{"style":311},[305,644,534],{"style":315},[305,646,568],{"style":311},[305,648,649],{"class":307,"style":308},[305,650,353],{"style":315},[11,652,653,654,656,657,660],{},"Overriding only ",[15,655,105],{}," renames the function and its export but keeps the default file name. Methods you leave out keep their defaults. Type names and their imports still come from the ",[15,658,659],{},"@kubb\u002Fplugin-ts"," resolver.",[11,662,663,664,667,668,24],{},"Per-request Playwright options do not belong here. Pass them in the helper's ",[15,665,666],{},"options"," argument, described in ",[20,669,671],{"href":670},"https:\u002F\u002Fkubb.dev\u002Fextensions\u002Fericlm\u002Fkubb-plugin-playwright\u002Fguides\u002Fnative-options-and-responses","Native options and responses",{"title":673,"searchDepth":674,"depth":674,"links":675},"",5,[676,678],{"id":28,"depth":677,"text":29},2,{"id":253,"depth":677,"text":254,"children":679},[680,682],{"id":258,"depth":681,"text":118},3,{"id":186,"depth":681,"text":186},"\u002Fextensions\u002Fericlm\u002Fkubb-plugin-playwright\u002Foptions",1793488212755]