{"version":3,"file":"abstract.mjs","sources":["../../../src/routes/providers/abstract.ts"],"sourcesContent":["import type { Core } from '@strapi/types';\n\nimport type { RoutesProvider } from './types';\n\n/**\n * Abstract class representing a provider for routes.\n *\n * This class provides a base implementation for classes that manage and provide\n * routes from Strapi.\n *\n * @implements {@link RoutesProvider}\n */\nexport abstract class AbstractRoutesProvider implements RoutesProvider {\n /**\n * Reference to the Strapi instance.\n */\n protected readonly _strapi: Core.Strapi;\n\n /**\n * @param strapi - The Strapi instance used to retrieve and manage routes.\n */\n public constructor(strapi: Core.Strapi) {\n this._strapi = strapi;\n }\n\n /**\n * Retrieves an array of routes.\n *\n * Classes extending this abstract class must provide their own implementation\n * for returning the list of routes they manage.\n */\n public abstract get routes(): Core.Route[];\n\n /**\n * Iterator to traverse the routes.\n *\n * This generator function allows iterating over the {@link Core.Route} objects\n * managed by this provider and yielding them one at a time.\n */\n public *[Symbol.iterator](): Iterator {\n for (const route of this.routes) {\n yield route;\n }\n }\n}\n"],"names":["AbstractRoutesProvider","Symbol","iterator","route","routes","strapi","_strapi"],"mappings":"AAIA;;;;;;;AAOC,IACM,MAAeA,sBAAAA,CAAAA;AAqBpB;;;;;AAKC,MACD,EAASC,MAAOC,CAAAA,QAAQ,CAAC,GAAyB;AAChD,QAAA,KAAK,MAAMC,KAAAA,IAAS,IAAI,CAACC,MAAM,CAAE;YAC/B,MAAMD,KAAAA;AACR;AACF;AAzBA;;MAGA,WAAA,CAAmBE,MAAmB,CAAE;QACtC,IAAI,CAACC,OAAO,GAAGD,MAAAA;AACjB;AAqBF;;;;"}