/** * The $LESSSECURE feature gate, like main.c's init_secure: with * LESSSECURE set nothing is allowed except what $LESSSECURE_ALLOW * names, and $LESSSECURE_DISALLOW subtracts from either state. */ type SecureFeature = 'edit' | 'examine' | 'glob' | 'history' | 'lesskey' | 'lessopen' | 'logfile' | 'osc8' | 'pipe' | 'shell' | 'stop' | 'tags'; /** * Reads the LESSSECURE environment, like init_secure — but a library * caller's overlay may only TIGHTEN what it finds. * * less is a program its user ran, so whoever sets LESSSECURE_ALLOW is * the same person who set LESSSECURE. A library call has two parties: * the deployment that hardened the environment, and the application * embedding the pager. Taking what BOTH permit means the application * can still restrict itself, and cannot hand back a feature the * environment took away. * * The ambient view is less's ladder, so $LESSNOCONFIG blanks LESSSECURE * exactly as it does in less (main.c reads no_config before init_secure, * and ignore_env then hides every name the list omits). Only the real * environment can set $LESSNOCONFIG, so a caller cannot reach for it * to wipe a policy it is not allowed to relax directly. Lesskey #env * lines cannot carry LESSSECURE in either program: less's init_secure * runs before init_cmds loads the tables, and so does ours. */ export declare function initSecure(): void; /** True when a feature may run, like secure_allow. */ export declare const secureAllow: (feature: SecureFeature) => boolean; export {};