UNPKG

@adonisjs-community/girouette

Version:

An AdonisJS package allowing decorators-based routing.

19 lines (18 loc) 578 B
import { ResourceActionNames } from '@adonisjs/core/types/http'; /** * The `@Only` decorator specifies which CRUD methods should be included in the resource. * * @param names The CRUD methods to include in the resource * * @example * ```ts * @Resource('/posts', 'blog.posts') * @Only(['index', 'show']) * export default class PostsController { * // Generates routes: * // GET /posts (blog.posts.index) * // GET /posts/:id (blog.posts.show) * } * ``` */ export declare const Only: (names: ResourceActionNames[]) => (target: any) => void;