> ## Documentation Index
> Fetch the complete documentation index at: https://styleguide-nextjs.2smooth.io/llms.txt
> Use this file to discover all available pages before exploring further.

# การประกาศ Interface/Type

export const CLASSIFICATION_TERMS = {
  positive: {
    must: '+MUST',
    should: '+SHOULD',
    optional: '+OPTIONAL'
  },
  negative: {
    must: '-MUST',
    should: '-SHOULD',
    optional: '-OPTIONAL'
  }
};

export const TextHighlight = ({text = '', positive = false, negative = false}) => {
  let textColor = undefined;
  let bgColor = undefined;
  if (positive) {
    textColor = 'black';
    bgColor = 'oklch(72.77% 0.1798 128.27)';
  }
  if (negative) {
    textColor = 'black';
    bgColor = 'oklch(51.73% 0.2119 28.74)';
  }
  return <div style={{
    display: 'inline-block',
    fontWeight: 'bold',
    paddingLeft: '4px',
    paddingRight: '4px',
    border: '1px solid',
    borderRadius: '8px',
    color: textColor,
    backgroundColor: bgColor
  }}>
      {text}
    </div>;
};

<AlertBox type={'warning'}>
  <span>ชื่อตัวแปร ฟังก์ชัน และ type ต่างๆ ที่หน้านี้ เป็นเพียงตัวอย่างเพื่อสื่อถึงการประกาศเท่านั้น</span>

  <br />

  <span>ห้ามใช้ชื่อที่ <strong>ไม่มี</strong> การสื่อความที่ดี และ เข้าใจยาก</span>
</AlertBox>

* <TextHighlight positive text={ CLASSIFICATION_TERMS.positive.must } /> ใช้ `namespace` ในการจัดกลุ่มของ `interface` / `type` เพื่อหลีกเลี่ยงชื่อซ้ำ

  <Icon icon={'circle-check'} color={'#85bb23'} size={32} /> ทำ

  ```ts theme={null}
  export namespace ModuleNamespace {
    export interface SampleInterface { ... }
    export type SampleType = { ... }
  }
  ```

  <Icon icon={'circle-xmark'} color={'#c50005'} size={32} /> ไม่ทำ

  ```ts theme={null}
  export interface SampleInterface { ... }
  export type SampleType = { ... }
  ```

* <TextHighlight positive text={ CLASSIFICATION_TERMS.positive.must } /> import ด้วยวิธีนี้เสมอ
  ```ts theme={null}
  import type { ModuleNamespace } from '<path-to-your-type>';
  ```
