Files
formipay/node_modules/minimist-options/index.d.ts
dwindown e8fbfb14c1 fix: prevent asset conflicts between React and Grid.js versions
Add coexistence checks to all enqueue methods to prevent loading
both React and Grid.js assets simultaneously.

Changes:
- ReactAdmin.php: Only enqueue React assets when ?react=1
- Init.php: Skip Grid.js when React active on admin pages
- Form.php, Coupon.php, Access.php: Restore classic assets when ?react=0
- Customer.php, Product.php, License.php: Add coexistence checks

Now the toggle between Classic and React versions works correctly.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-18 17:02:14 +07:00

56 lines
1.7 KiB
TypeScript

import {Opts as MinimistOptions} from 'minimist';
export type OptionType = 'string' | 'boolean' | 'number' | 'array' | 'string-array' | 'boolean-array' | 'number-array';
export interface BaseOption<
TypeOptionType extends OptionType,
DefaultOptionType
> {
/**
* The data type the option should be parsed to.
*/
readonly type?: TypeOptionType;
/**
* An alias/list of aliases for the option.
*/
readonly alias?: string | ReadonlyArray<string>;
/**
* The default value for the option.
*/
readonly default?: DefaultOptionType;
}
export type StringOption = BaseOption<'string', string>;
export type BooleanOption = BaseOption<'boolean', boolean>;
export type NumberOption = BaseOption<'number', number>;
export type DefaultArrayOption = BaseOption<'array', ReadonlyArray<string>>;
export type StringArrayOption = BaseOption<'string-array', ReadonlyArray<string>>;
export type BooleanArrayOption = BaseOption<'boolean-array', ReadonlyArray<boolean>>;
export type NumberArrayOption = BaseOption<'number-array', ReadonlyArray<number>>;
type MinimistOption = NonNullable<
| MinimistOptions['stopEarly']
| MinimistOptions['unknown']
| MinimistOptions['--']
>;
export type Options = {
[key: string]:
| OptionType
| StringOption
| BooleanOption
| NumberOption
| DefaultArrayOption
| StringArrayOption
| BooleanArrayOption
| NumberArrayOption
| MinimistOption; // Workaround for https://github.com/microsoft/TypeScript/issues/17867
};
/**
* Write options for [minimist](https://npmjs.org/package/minimist) in a comfortable way. Support string, boolean, number and array options.
*/
export default function buildOptions(options?: Options): MinimistOptions;