Skip to content

Instantly share code, notes, and snippets.

@mikesprague
Last active August 15, 2025 19:25
Show Gist options
  • Save mikesprague/048a93b832e2862050356ca233ef4dc1 to your computer and use it in GitHub Desktop.
Save mikesprague/048a93b832e2862050356ca233ef4dc1 to your computer and use it in GitHub Desktop.

Revisions

  1. mikesprague revised this gist Jan 4, 2023. No changes.
  2. mikesprague revised this gist Jan 4, 2023. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion weatherkit-condition-codes.ts
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,6 @@
    // WeatherKit REST API documentation lists `conditionCode` as a property returned for
    // various DataSets and says it's an enumeration value (e.g. https://developer.apple.com/documentation/weatherkitrestapi/currentweather/currentweatherdata)
    // various DataSets and says it's an enumeration value
    // (e.g. https://developer.apple.com/documentation/weatherkitrestapi/currentweather/currentweatherdata)
    // but never says what the possible return values could be anywhere in the REST API docs
    //
    // The following was created from info in the Swift documentation: https://developer.apple.com/documentation/weatherkit/weathercondition
  3. mikesprague revised this gist Jan 4, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion weatherkit-condition-codes.ts
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@
    // various DataSets and says it's an enumeration value (e.g. https://developer.apple.com/documentation/weatherkitrestapi/currentweather/currentweatherdata)
    // but never says what the possible return values could be anywhere in the REST API docs
    //
    // The following list was created from info in the Swift documentation: https://developer.apple.com/documentation/weatherkit/weathercondition
    // The following was created from info in the Swift documentation: https://developer.apple.com/documentation/weatherkit/weathercondition

    export interface ConditionCode {
    code: string;
  4. mikesprague revised this gist Jan 4, 2023. 1 changed file with 13 additions and 12 deletions.
    25 changes: 13 additions & 12 deletions weatherkit-condition-codes.ts
    Original file line number Diff line number Diff line change
    @@ -4,6 +4,19 @@
    //
    // The following list was created from info in the Swift documentation: https://developer.apple.com/documentation/weatherkit/weathercondition

    export interface ConditionCode {
    code: string;
    description: string;
    type:
    | 'visibility'
    | 'wind'
    | 'precipitation'
    | 'hazardous'
    | 'winter-precipitation'
    | 'hazardous-winter'
    | 'tropical-hazard';
    }

    export const conditionCodes: ConditionCode[] = [
    {
    code: 'BlowingDust',
    @@ -178,15 +191,3 @@ export const conditionCodes: ConditionCode[] = [
    },
    ];

    export interface ConditionCode {
    code: string;
    description: string;
    type:
    | 'visibility'
    | 'wind'
    | 'precipitation'
    | 'hazardous'
    | 'winter-precipitation'
    | 'hazardous-winter'
    | 'tropical-hazard';
    }
  5. mikesprague revised this gist Jan 4, 2023. 1 changed file with 3 additions and 5 deletions.
    8 changes: 3 additions & 5 deletions weatherkit-condition-codes.ts
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,8 @@
    // WeatherKit REST API documentation lists `conditionCode` as a property returned for
    // various DataSets but and says it's an enumeration value
    // (e.g. https://developer.apple.com/documentation/weatherkitrestapi/currentweather/currentweatherdata)
    // but never says what the possible return valuers are anywhere in the REST API docs
    // various DataSets and says it's an enumeration value (e.g. https://developer.apple.com/documentation/weatherkitrestapi/currentweather/currentweatherdata)
    // but never says what the possible return values could be anywhere in the REST API docs
    //
    // The following list was created from the info in the Swift documentation:
    // https://developer.apple.com/documentation/weatherkit/weathercondition
    // The following list was created from info in the Swift documentation: https://developer.apple.com/documentation/weatherkit/weathercondition

    export const conditionCodes: ConditionCode[] = [
    {
  6. mikesprague created this gist Jan 4, 2023.
    194 changes: 194 additions & 0 deletions weatherkit-condition-codes.ts
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,194 @@
    // WeatherKit REST API documentation lists `conditionCode` as a property returned for
    // various DataSets but and says it's an enumeration value
    // (e.g. https://developer.apple.com/documentation/weatherkitrestapi/currentweather/currentweatherdata)
    // but never says what the possible return valuers are anywhere in the REST API docs
    //
    // The following list was created from the info in the Swift documentation:
    // https://developer.apple.com/documentation/weatherkit/weathercondition

    export const conditionCodes: ConditionCode[] = [
    {
    code: 'BlowingDust',
    description: 'Blowing dust or sandstorm',
    type: 'visibility',
    },
    {
    code: 'Clear',
    description: 'Clear',
    type: 'visibility',
    },
    {
    code: 'Cloudy',
    description: 'Cloudy, overcast conditions',
    type: 'visibility',
    },
    {
    code: 'Foggy',
    description: 'Fog',
    type: 'visibility',
    },
    {
    code: 'Haze',
    description: 'Haze',
    type: 'visibility',
    },
    {
    code: 'MostlyClear',
    description: 'Mostly clear',
    type: 'visibility',
    },
    {
    code: 'MostlyCloudy',
    description: 'Mostly cloudy',
    type: 'visibility',
    },
    {
    code: 'PartlyCloudy',
    description: 'Partly cloudy',
    type: 'visibility',
    },
    {
    code: 'Smoky',
    description: 'Smoky',
    type: 'visibility',
    },
    {
    code: 'Breezy',
    description: 'Breezy, light wind',
    type: 'wind',
    },
    {
    code: 'Windy',
    description: 'Windy',
    type: 'wind',
    },
    {
    code: 'Drizzle',
    description: 'Drizzle or light rain',
    type: 'precipitation',
    },
    {
    code: 'HeavyRain',
    description: 'Heavy rain',
    type: 'precipitation',
    },
    {
    code: 'IsolatedThunderstorms',
    description: 'Thunderstorms covering less than 1/8 of the forecast area',
    type: 'precipitation',
    },
    {
    code: 'Rain',
    description: 'Rain',
    type: 'precipitation',
    },
    {
    code: 'SunShowers',
    description: 'Rain with visible sun',
    type: 'precipitation',
    },
    {
    code: 'ScatteredThunderstorms',
    description:
    'Numerous thunderstorms spread across up to 50% of the forecast area',
    type: 'precipitation',
    },
    {
    code: 'StrongStorms',
    description: 'Notably strong thunderstorms',
    type: 'precipitation',
    },
    {
    code: 'Thunderstorms',
    description: 'Thunderstorms',
    type: 'precipitation',
    },
    {
    code: 'Frigid',
    description: 'Frigid conditions, low temperatures, or ice crystals',
    type: 'hazardous',
    },
    {
    code: 'Hail',
    description: 'Hail',
    type: 'hazardous',
    },
    {
    code: 'Hot',
    description: 'High temperatures',
    type: 'hazardous',
    },
    {
    code: 'Flurries',
    description: 'Flurries or light snow',
    type: 'winter-precipitation',
    },
    {
    code: 'Sleet',
    description: 'Sleet',
    type: 'winter-precipitation',
    },
    {
    code: 'Snow',
    description: 'Snow',
    type: 'winter-precipitation',
    },
    {
    code: 'SunFlurries',
    description: 'Snow flurries with visible sun',
    type: 'winter-precipitation',
    },
    {
    code: 'WintryMix',
    description: 'Wintry mix',
    type: 'winter-precipitation',
    },
    {
    code: 'Blizzard',
    description: 'Blizzard',
    type: 'hazardous-winter',
    },
    {
    code: 'BlowingSnow',
    description: 'Blowing or drifting snow',
    type: 'hazardous-winter',
    },
    {
    code: 'FreezingDrizzle',
    description: 'Freezing drizzle or light rain',
    type: 'hazardous-winter',
    },
    {
    code: 'FreezingRain',
    description: 'Freezing rain',
    type: 'hazardous-winter',
    },
    {
    code: 'HeavySnow',
    description: 'Heavy snow',
    type: 'hazardous-winter',
    },
    {
    code: 'Hurricane',
    description: 'Hurricane',
    type: 'tropical-hazard',
    },
    {
    code: 'TropicalStorm',
    description: 'Tropical storm',
    type: 'tropical-hazard',
    },
    ];

    export interface ConditionCode {
    code: string;
    description: string;
    type:
    | 'visibility'
    | 'wind'
    | 'precipitation'
    | 'hazardous'
    | 'winter-precipitation'
    | 'hazardous-winter'
    | 'tropical-hazard';
    }